Support for secondary constructors in j2k

This commit is contained in:
Valentin Kipyatkov
2015-03-06 19:21:30 +01:00
parent b44dbe6ca2
commit 569e4a68ae
33 changed files with 367 additions and 589 deletions
@@ -1,17 +1,13 @@
// ERROR: Cannot access 'staticFoo': it is 'private' in 'Default'
// ERROR: Cannot access 'staticFoo': it is 'private' in 'Default'
fun C(arg1: Int, arg2: Int, other: C): C {
val __ = C(arg1, arg2, 0)
System.out.println(__.foo(1) + __.foo(2) + other.foo(3) + C.staticFoo(4) + C.staticFoo(5))
return __
}
class C(private val arg1: Int, private val arg2: Int, private val arg3: Int) {
fun foo(p: Int): Int {
return p
}
constructor(arg1: Int, arg2: Int, other: C) : this(arg1, arg2, 0) {
System.out.println(foo(1) + this.foo(2) + other.foo(3) + staticFoo(4) + C.staticFoo(5))
}
default object {
private fun staticFoo(p: Int): Int {
return p