mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-16 15:53:55 +00:00
This commit contains minor changes in testdata, where test and behavior change are not related
23 lines
399 B
Kotlin
Vendored
23 lines
399 B
Kotlin
Vendored
// !LANGUAGE: -NestedClassesInEnumEntryShouldBeInner
|
|
|
|
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"
|
|
}
|