Files
kotlin-fork/backend.native/tests/external/codegen/blackbox/enum/enumShort.kt
T
Ilya Matveev 1b553ebfaf backend/tests: Add blackbox tests from Kotlin JVM
Added tests from testData/codegen/box directory. There are blackbox tests
in other directories and they are to be added.
2017-01-20 14:04:04 +03:00

12 lines
238 B
Kotlin

enum class Color(val rgb: Int) {
RED(0xff0000),
GREEN(0x00ff00),
BLUE(0x0000ff);
}
fun foo(): Int {
return Color.RED.rgb + Color.GREEN.rgb + Color.BLUE.rgb
}
fun box() = if (foo() == 0xffffff) "OK" else "Fail: ${foo()}"