Files
kotlin/compiler/testData/codegen/boxWithJava/enum/staticField.kt
Alexander Udalov a9776016a9 Resolve static methods of enum in front-end
Up to this point, front-end did not suspect that there could be classes which
have both a class object and a package for static members. Since this became
possible for enums loaded from Java binaries (enum entries and valueOf()/
values() are placed into the class object, and every other static member into
the package), we adjust the corresponding scope to also include members from
the corresponding package

 #KT-2990 Fixed
2013-03-15 16:00:57 +04:00

13 lines
354 B
Kotlin

import test.staticField as E
fun box(): String {
val instances = E.INSTANCES
if (E.foo != 42)
return "Wrong foo ${E.foo}"
if (instances.size() != 1)
return "Wrong size ${instances.size()}"
if (E.INSTANCES.iterator().next() != E.INSTANCE)
return "Wrong instance ${E.INSTANCES.iterator().next()}"
return "OK"
}