JVM_IR: add $assertionsDisabled when an inlined function uses it
NOTE: jvmCrossinlineLambdaDeclarationSite.kt is muted because the inliner does not remap references to an anonymous object's parent class after regenerating it. Unlike the JVM backend, JVM_IR uses the top level named class' assertion status for all inner classes. (The test used to pass because the lambda in `inline fun call` read the `$assertionsDisabled` field of `CrossinlineLambdaContainer`, which was not reloaded after changing the assertion status of package `test`.)
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
// Not a multi-module test.
|
||||
// IGNORE_BACKEND_MULTI_MODULE: JVM, JVM_IR
|
||||
// FILE: A.kt
|
||||
// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm
|
||||
// WITH_RUNTIME
|
||||
// FULL_JDK
|
||||
|
||||
class A {
|
||||
inline fun inlineMe(crossinline c : () -> String) = {
|
||||
assert(true)
|
||||
c()
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: B.java
|
||||
import kotlin.jvm.functions.Function0;
|
||||
|
||||
public class B {
|
||||
public static String check() {
|
||||
return new A().inlineMe(new Function0<String>() {
|
||||
@Override public String invoke() { return "OK"; }
|
||||
}).invoke();
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: box.kt
|
||||
fun box(): String = B.check()
|
||||
Reference in New Issue
Block a user