KT-53090 Support -Xlambdas=indy for anonymous functions

This commit is contained in:
Pavel Mikhailovskii
2022-07-11 11:09:49 +02:00
committed by teamcity
parent 2693a29ab6
commit fd5800e8b5
8 changed files with 158 additions and 8 deletions
@@ -0,0 +1,22 @@
// 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 {
assert((@SomeAnnotation {}) is Lambda<*>)
assert((@SomeAnnotation fun () {}) is Lambda<*>)
assert((@SomeAnnotation fun Any.() {}) is Lambda<*>)
return "OK"
}