Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
💻 🏃

Jackson Davis jcdavis

💭
💻 🏃
View GitHub Profile
@forax
forax / Constantifier.java
Created Jan 12, 2018
How to simulate @stable semantics with method handles ?
View Constantifier.java
import static java.lang.invoke.MethodHandles.constant;
import static java.lang.invoke.MethodHandles.dropArguments;
import static java.lang.invoke.MethodHandles.exactInvoker;
import static java.lang.invoke.MethodHandles.foldArguments;
import static java.lang.invoke.MethodHandles.lookup;
import static java.lang.invoke.MethodType.methodType;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodHandles.Lookup;