Files
kotlin-fork/compiler/testData/codegen/box/regressions/kt3850.kt
T
Alexander Udalov 4ac6f01d31 Add ReplaceWithSupertypeAnonymousTypeTransformer to light analysis tests
To make these tests behave closer to kapt, since kapt is the primary use
case for the light analysis mode.

AbstractLightAnalysisModeTest compares the text dump of bytecode
obtained with full analysis and light analysis, removing things like
anonymous/synthetic entities. In the light analysis mode anonymous
objects in supertypes are always approximated, and in the full analysis
mode they are always present as is in signatures. So we're transforming
the text dump in the same way, by approximating anonymous objects in
signatures (more precisely, in return types of methods and fields) to
the supertype.
2023-06-22 17:10:51 +02:00

12 lines
328 B
Kotlin
Vendored

// !LANGUAGE: -PrivateInFileEffectiveVisibility
// In light analysis mode, anonymous object type is approximated to the supertype, so `fy` is unresolved.
// IGNORE_LIGHT_ANALYSIS
private class One {
val a1 = arrayOf(
object { val fy = "text"}
)
}
fun box() = if (One().a1[0].fy == "text") "OK" else "fail"