Files
kotlin-fork/compiler/testData/codegen/boxInline/smap/assertion.kt
T
2018-06-28 17:12:09 +02:00

75 lines
939 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
//TODO maybe do smth with default method body mapping
SMAP
1.kt
Kotlin
*S Kotlin
*F
+ 1 1.kt
test/_1Kt
*L
1#1,25:1
18#1,6:26
*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
17#2,7:15
8#2,7:22
*E
*S KotlinDebug
*F
+ 1 2.kt
_2Kt
*L
6#1,7:15
7#1,7:22
*E