Files
kotlin-fork/compiler/testData/codegen/boxInline/smap/assertion.kt
T
pyos d17a18f96d JVM: do not write trivial SMAPs to classes outside inline funs
where trivial == those that map the file to itself.
2020-05-25 20:03:56 +02:00

64 lines
812 B
Kotlin
Vendored

// FILE: 1.kt
package test
public val MASSERTIONS_ENABLED: Boolean = true
public inline fun massert(value: Boolean, lazyMessage: () -> String) {
if (MASSERTIONS_ENABLED) {
if (!value) {
val message = lazyMessage()
throw AssertionError(message)
}
}
}
public inline fun massert(value: Boolean, message: Any = "Assertion failed") {
if (MASSERTIONS_ENABLED) {
if (!value) {
throw AssertionError(message)
}
}
}
// FILE: 2.kt
import test.*
fun box(): String {
massert(true)
massert(true) {
"test"
}
return "OK"
}
// FILE: 1.smap
// FILE: 2.smap
SMAP
2.kt
Kotlin
*S Kotlin
*F
+ 1 2.kt
_2Kt
+ 2 1.kt
test/_1Kt
*L
1#1,14:1
18#2,7:15
9#2,7:22
*E
*S KotlinDebug
*F
+ 1 2.kt
_2Kt
*L
6#1,7:15
7#1,7:22
*E