Files
kotlin-fork/js/js.translator/testFiles/extensionProperty/cases/propertyWithGetterAndSetter.kt
T
develar d4d300d0e9 Requested only one commit pull request (was: https://github.com/JetBrains/kotlin/pull/59/files).
Note: all tests passed, but I haven't tested this build in real life (opposite to my master branch).

Don't remember about critical issue — http://youtrack.jetbrains.com/issue/KT-2154 Fix for this issue is not included in this patch (because unrelated). Fix for it and for all other unrelated changes will be opened as separated pull-requests.
2012-06-05 19:29:20 +04:00

26 lines
427 B
Kotlin

package foo
class Test() {
var a = 0
}
var Test.b : Int
get() = a * 3
set(c : Int) {
a = c - 1
}
val Test.d : Int = 44
fun box() : Boolean {
val c = Test()
if (c.a != 0) return false;
if (c.b != 0) return false;
c.a = 3;
if (c.b != 9) return false;
c.b = 10;
if (c.a != 9) return false;
if (c.b != 27) return false;
if (c.d != 44) return false;
return true;
}