TEST: primary/secondary constructor fields initialization

This commit is contained in:
Vasily Levchenko
2016-11-24 09:58:36 +03:00
committed by vvlevchenko
parent 62917fd171
commit 48ee81548e
3 changed files with 24 additions and 0 deletions
@@ -0,0 +1,8 @@
class B(val a:Int, b:Int) {
constructor(pos:Int):this(1, pos) {}
val pos = b + 1
}
fun primaryConstructorCall(a:Int, b:Int) = B(a, b).pos
fun secondaryConstructorCall(a:Int) = B(a).pos