Files
kotlin-fork/compiler/testData/codegen/box/enum/objectInEnum.kt
T
Denis Zharkov a5545b96cb FIR: Fix ambiguity between current Companion and one from supertypes
Companion as qualifier should be found at static scope not a member one
2020-11-10 14:26:54 +03:00

24 lines
425 B
Kotlin
Vendored

// !LANGUAGE: -NestedClassesInEnumEntryShouldBeInner
// IGNORE_BACKEND: NATIVE
enum class E {
ENTRY,
SUBCLASS {
object O {
fun foo() = 2
}
override fun bar() = O.foo()
};
object O {
fun foo() = 1
}
open fun bar() = O.foo()
}
fun box(): String {
if (E.ENTRY.bar() != 1) return "Fail 1"
if (E.SUBCLASS.bar() != 2) return "Fail 2"
return "OK"
}