mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
We always set the $assertionsDisabled field based on the top-level enclosing class. This means that for anonymous objects we have to rewrite the call to Class.desiredAssertionStatus.
21 lines
563 B
Kotlin
Vendored
21 lines
563 B
Kotlin
Vendored
// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm
|
|
|
|
inline fun inlineMe(crossinline c : () -> Unit) = {
|
|
assert(true)
|
|
c()
|
|
}
|
|
|
|
class A {
|
|
fun inlineSite() {
|
|
inlineMe { }
|
|
}
|
|
}
|
|
|
|
// inlineSite:
|
|
// 1 GETSTATIC A\$inlineSite\$\$inlined\$inlineMe\$1.\$assertionsDisabled
|
|
// A.<clinit>:
|
|
// 1 LDC LA;.class\s*INVOKEVIRTUAL java/lang/Class.desiredAssertionStatus \(\)Z
|
|
// 1 PUTSTATIC A\$inlineSite\$\$inlined\$inlineMe\$1.\$assertionsDisabled : Z
|
|
// in declaration site and in inline site
|
|
// 2 INVOKEVIRTUAL java/lang/Class.desiredAssertionStatus \(\)Z
|