Files
kotlin/compiler/testData/codegen/box/enum/classObjectInEnum.kt
Alexander Udalov 128c938965 Make Array.size() a function instead of a property
Also add a deprecated extension property to help migration. This is done to
unify getting size of arrays and collections
2014-11-17 15:02:38 +03:00

20 lines
459 B
Kotlin

enum class Game {
ROCK
PAPER
SCISSORS
class object {
fun foo() = ROCK
val bar = PAPER
}
}
fun box(): String {
if (Game.foo() != Game.ROCK) return "Fail 1"
// TODO: fix initialization order and uncomment (KT-5761)
// if (Game.bar != Game.PAPER) return "Fail 2: ${Game.bar}"
if (Game.values().size() != 3) return "Fail 3"
if (Game.valueOf("SCISSORS") != Game.SCISSORS) return "Fail 4"
return "OK"
}