Java to Kotlin converter: secondary constructors are converted to top-level functions instead of "create" functions in class object

This commit is contained in:
Valentin Kipyatkov
2014-06-26 20:01:28 +04:00
parent f698ca69d7
commit 66005a3469
25 changed files with 225 additions and 256 deletions
@@ -1,18 +1,15 @@
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
}
class object {
private fun staticFoo(p: Int): Int {
return p
}
fun create(arg1: Int, arg2: Int, other: C): C {
val __ = C(arg1, arg2, 0)
System.out.println(__.foo(1) + __.foo(2) + other.foo(3) + staticFoo(4) + C.staticFoo(5))
return __
}
private fun staticFoo(p: Int): Int {
return p
}
}
}