Files
kotlin-fork/js/js.translator/testData/extensionProperty/cases/simplePropertyWithGetter.kt
T
2015-09-19 05:04:05 +03:00

16 lines
344 B
Kotlin
Vendored

package foo
val String.prop: Int
get() = length()
val Int.quadruple: Int
get() = this * 4
fun box(): Boolean {
if ("1".prop != 1) return false;
if ("11".prop != 2) return false;
if (("121" + "123").prop != 6) return false;
if (1.quadruple != 4) return false;
if (0.quadruple != 0) return false;
return true;
}