Files
Alexander Udalov 19bbcc5869 Do not generate metadata for callable reference classes
After an accidental change in 846537b367, we started generating metadata
into anonymous classes for callable references. This metadata contained
the Kotlin representation of the referenced function. In KT-53794, this
led to a problem where Java's protected visibility could not be
represented in Kotlin terms, which crashed the backend.

But also, this metadata is useless because there's no real use case for
interpreting it (since you already have a function reference object at
runtime with all the needed information), so it would take some extra
space in the bytecode.

 #KT-53794 Fixed
2022-09-01 12:15:25 +02:00

10 lines
387 B
Kotlin
Vendored

// TARGET_BACKEND: JVM_IR
fun f() {}
fun g() = ::f
// This regexp checks that there's only one class annotated with kotlin.Metadata with the actual data (which is in the `d1` field).
// That class is the file facade. The synthetic class for the reference `::f` should be generated with synthetic metadata, i.e.
// which has nothing in the `d1` field.
// 1 @Lkotlin/Metadata;\(.*d1.*\)