Skip to content

Instantly share code, notes, and snippets.

View jcdavis's full-sized avatar
💭
💻 🏃

Jackson Davis jcdavis

💭
💻 🏃
View GitHub Profile
@forax
forax / Constantifier.java
Created January 12, 2018 17:33
How to simulate @stable semantics with method handles ?
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;