Files
kotlin-fork/compiler/testData/codegen/boxInline/smap/assertion.kt
T
2019-09-06 09:19:57 +03:00

76 lines
978 B
Kotlin
Vendored

// IGNORE_BACKEND_MULTI_MODULE: JVM_IR
// 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
//TODO maybe do smth with default method body mapping
SMAP
1.kt
Kotlin
*S Kotlin
*F
+ 1 1.kt
test/_1Kt
*L
1#1,26:1
19#1,6:27
*E
// 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