Files
kotlin-fork/compiler/testData/codegen/box/objects/substitutionFunctionFromSuper.kt
T
Nikolay Lunyak bcfafc601e Add EnumEntries to minimal-stdlib-for-tests
This change allows to revert adding `WITH_STDLIB` directive
to tests which happened at `a9343aeb`.

Co-authored-by: Alexander Udalov <Alexander.Udalov@jetbrains.com>
2023-03-02 10:23:38 +00:00

29 lines
477 B
Kotlin
Vendored

// KT-44054
enum class Enum {
Entry1,
Entry2
}
class Outer {
fun fooCaller(): Enum = obj.foo()
private abstract inner class Inner<T>(val default: T) {
fun foo(): T {
return default
}
}
private val obj = object : Inner<Enum>(Enum.Entry1) {
fun bar(): Enum {
return default
}
}
}
fun box(): String {
val o = Outer()
if (o.fooCaller() != Enum.Entry1) return "Fail"
return "OK"
}