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:
committed by
Mikhail Glukhikh
parent
7f50e6e70e
commit
28b70faa99
+5
@@ -0,0 +1,5 @@
|
||||
class Hello<caret>(val x: String) {
|
||||
val y = "Hello"
|
||||
|
||||
val z = x + y
|
||||
}
|
||||
+12
@@ -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
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
object Storage {
|
||||
val hello = "Hello"
|
||||
}
|
||||
|
||||
class Hello<caret>(val x: String) {
|
||||
val y = Storage.hello
|
||||
|
||||
val z = x + y
|
||||
}
|
||||
Vendored
+16
@@ -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
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
fun foo(x: Int) {
|
||||
class Local<caret>(val y: Int) {
|
||||
val z = x
|
||||
}
|
||||
}
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
fun foo(x: Int) {
|
||||
class Local {
|
||||
val y: Int
|
||||
|
||||
constructor(y: Int) {
|
||||
this.y = y
|
||||
}
|
||||
|
||||
val z: Int = x
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user