KT-9839: convert primary constructor to secondary one: leave independent properties in class body as is

(cherry picked from commit b90414a)
This commit is contained in:
Mikhail Glukhikh
2016-09-29 15:49:21 +03:00
committed by Mikhail Glukhikh
parent 7f50e6e70e
commit 28b70faa99
8 changed files with 102 additions and 1 deletions
@@ -0,0 +1,5 @@
class Hello<caret>(val x: String) {
val y = "Hello"
val z = x + y
}
@@ -0,0 +1,12 @@
class Hello {
val x: String
constructor(x: String) {
this.x = x
this.z = x + y
}
val y: String = "Hello"
val z: String
}
@@ -0,0 +1,9 @@
object Storage {
val hello = "Hello"
}
class Hello<caret>(val x: String) {
val y = Storage.hello
val z = x + y
}
@@ -0,0 +1,16 @@
object Storage {
val hello = "Hello"
}
class Hello {
val x: String
constructor(x: String) {
this.x = x
this.z = x + y
}
val y: String = Storage.hello
val z: String
}
@@ -0,0 +1,5 @@
fun foo(x: Int) {
class Local<caret>(val y: Int) {
val z = x
}
}
@@ -0,0 +1,11 @@
fun foo(x: Int) {
class Local {
val y: Int
constructor(y: Int) {
this.y = y
}
val z: Int = x
}
}