Files
kotlin-fork/compiler/testData/codegen/super/basicproperty.kt
T
Alexander Udalov 0df71bd696 Refactor codegen tests
- initialize environment only once in setUp()
- add comments on why some tests are disabled
- modify and rename some tests
- re-enable now working tests
- extract some tests into files with box()
- remove useless 'throws' declarations and commented code
2013-01-24 21:12:27 +04:00

25 lines
396 B
Kotlin

open class M() {
open var b: Int = 0
}
class N() : M() {
val a : Int
get() {
super.b = super.b + 1
return super.b + 1
}
override var b: Int = a + 1
val superb : Int
get() = super.b
}
fun box(): String {
val n = N()
n.a
n.b
n.superb
if (n.b == 3 && n.a == 4 && n.superb == 3) return "OK";
return "fail";
}