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,3 +1,8 @@
// this is a secondary constructor
fun A(): A {
return A(1)
} // end of secondary constructor body
class A// this is a primary constructor
(p: Int) {
private val v: Int
@@ -5,14 +10,6 @@ class A// this is a primary constructor
{
v = 1
} // end of primary constructor body
class object {
// this is a secondary constructor
fun create(): A {
return A(1)
} // end of secondary constructor body
}
}
class B// this constructor will disappear