Files
kotlin-fork/compiler/testData/codegen/super/traitproperty.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

32 lines
536 B
Kotlin

trait M {
var backingB : Int
var b : Int
get() = backingB
set(value: Int) {
backingB = value
}
}
class N() : M {
public override var backingB : Int = 0
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";
}