JVM: do not write trivial SMAPs to classes outside inline funs

where trivial == those that map the file to itself.
This commit is contained in:
pyos
2020-04-23 14:42:22 +02:00
committed by max-kammerer
parent a04aeeb4e1
commit d17a18f96d
30 changed files with 121 additions and 204 deletions
@@ -13,14 +13,3 @@ fun box(): String {
}
// FILE: 2.smap
SMAP
2.kt
Kotlin
*S Kotlin
*F
+ 1 2.kt
_2Kt
*L
1#1,7:1
*E
@@ -18,14 +18,3 @@ fun box(): String {
}
// FILE: 2.smap
SMAP
2.kt
Kotlin
*S Kotlin
*F
+ 1 2.kt
_2Kt
*L
1#1,8:1
*E
@@ -0,0 +1,21 @@
// FILE: 1.kt
package test
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
@kotlin.internal.InlineOnly
inline fun <T, R> T.myLet(block: (T) -> R) = block(this)
// FILE: 2.kt
import test.*
fun box(): String {
// should not have any line numbers
val k = "".myLet {
it + "K"
}
return "O".myLet(fun (it: String): String {
return it + k
})
}
// FILE: 2.smap
@@ -0,0 +1,16 @@
// FILE: 1.kt
package test
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
@kotlin.internal.InlineOnly
inline fun <T, R> T.myLet(block: (T) -> R) = block(this)
// FILE: 2.kt
import test.*
fun box(): String {
val k = "".myLet { it + "K" }
return "O".myLet(fun (it: String): String { return it + k })
}
// FILE: 2.smap