JVM: move synthetic line number generation to the inliner

This makes the behavior of JVM and JVM_IR the same without having to
deal with PSI nodes.
This commit is contained in:
pyos
2020-04-23 14:34:13 +02:00
committed by max-kammerer
parent 91b6daeacc
commit deecb6a28e
7 changed files with 70 additions and 30 deletions

View File

@@ -0,0 +1,11 @@
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
@kotlin.internal.InlineOnly
inline fun <T, R> T.myLet(block: (T) -> R) = block(this)
fun box(): String {
val k = "".myLet { it + "K" }
return "O".myLet(fun (it: String): String { return it + k })
}
// See KT-23064 for the problem and InlineOnlySmapSkipper for an explanation.
// 2 LINENUMBER 65100