c4255f9a9e
This commit adds missing pieces for the puzzle: Annotation instantiation feature uses IrProperty's initializer to instantiate properties from other modules that have default values which weren't specified on call site. To support this feature properly, Fir2IrVisitor should fill LazyIrProperty's backing field initializer with information from Fir. To get this information into Fir, FirMemberDeserializer should be able to read it from KotlinJvmBinaryClass with AnnotationLoaderVisitorImpl. (klibs are unsupported for now) There's a catch with enum entries references: we can't access session.SymbolProvider to resolve it because we're still at the deserialization stage, and it can cause StackOverflow if enum is nested in the same class (see RequiresOptIn.Level). To mitigate this, a new FirEnumEntryDeserializedAccessExpression is produced instead; it is later replaced with the correct reference in the Fir2IrVisitor. ^KT-58137 Fixed Also add test to loadJava folder with annotations default values that verifies metadata loading
34 lines
1.0 KiB
Plaintext
Vendored
34 lines
1.0 KiB
Plaintext
Vendored
public final annotation class Anno : R|kotlin/Annotation| {
|
|
public final val value: R|kotlin/String| = String(0)
|
|
public get(): R|kotlin/String|
|
|
|
|
public final val x: R|kotlin/Int| = Int(0)
|
|
public get(): R|kotlin/Int|
|
|
|
|
public constructor(value: R|kotlin/String| = STUB, x: R|kotlin/Int| = STUB): R|test/Anno|
|
|
|
|
}
|
|
|
|
public final annotation class Bnno : R|kotlin/Annotation| {
|
|
public constructor(): R|test/Bnno|
|
|
|
|
}
|
|
|
|
public final enum class Eee : R|kotlin/Enum<test/Eee>| {
|
|
private constructor(): R|test/Eee|
|
|
|
|
public final static enum entry Entry1: R|test/Eee|
|
|
public final static enum entry Entry2: R|test/Eee|
|
|
public final static enum entry Entry3: R|test/Eee|
|
|
public final static enum entry Entry4: R|test/Eee|
|
|
public final static fun values(): R|kotlin/Array<test/Eee>| {
|
|
}
|
|
|
|
public final static fun valueOf(value: R|kotlin/String|): R|test/Eee| {
|
|
}
|
|
|
|
public final static val entries: R|kotlin/enums/EnumEntries<test/Eee>|
|
|
public get(): R|kotlin/enums/EnumEntries<test/Eee>|
|
|
|
|
}
|