4f66d5bb1c
Do not check that non-indy-generated lambdas inherit from Lambda, because when we enable indy lambdas by default, we're also changing the behavior of non-indy lambdas so that they won't have the Lambda superclass anymore (see KT-45375). Since this test was added to check that any annotation disables indy lambda generation, just leave those lambdas and rely on the CHECK_BYTECODE_TEXT directive to verify that there are no LambdaMetafactory in the bytecode text.
23 lines
460 B
Kotlin
Vendored
23 lines
460 B
Kotlin
Vendored
// LAMBDAS: INDY
|
|
// TARGET_BACKEND: JVM
|
|
// JVM_TARGET: 1.8
|
|
// WITH_STDLIB
|
|
|
|
// CHECK_BYTECODE_TEXT
|
|
// JVM_IR_TEMPLATES
|
|
// 0 java/lang/invoke/LambdaMetafactory
|
|
|
|
import kotlin.jvm.internal.Lambda
|
|
|
|
@Target(AnnotationTarget.EXPRESSION)
|
|
@Retention(AnnotationRetention.SOURCE)
|
|
public annotation class SomeAnnotation
|
|
|
|
fun box(): String {
|
|
val a = @SomeAnnotation {}
|
|
val b = @SomeAnnotation fun () {}
|
|
val c = @SomeAnnotation fun Any.() {}
|
|
|
|
return "OK"
|
|
}
|