Created
October 12, 2018 20:34
-
-
Save jonnyzzz/ad8e2726f7522e86b5a58b0d913a2593 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun callWithLambda(x: () -> Unit) = x() | |
inline fun callW(crossinline x: () -> Unit) { | |
callWithLambda { | |
x() | |
x() | |
} | |
} | |
fun main(args: Array<String>) { | |
callW { println("ddds") } | |
//the callW is inlined. | |
//the x();x() is also inlined into the lambda, having | |
//public final void invoke() { | |
// String var1 = "ddds"; | |
// System.out.println(var1); | |
// var1 = "ddds"; | |
// System.out.println(var1); | |
// } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment