KT-18786: J2K should move all properties to top of class
#KT-18786 fixed
This commit is contained in:
+14
-14
@@ -15,20 +15,6 @@ internal class A {
|
||||
private var field9: String? = "a"
|
||||
private var field10: String? = foo()
|
||||
|
||||
fun foo(): String {
|
||||
return "x"
|
||||
}
|
||||
|
||||
fun bar() {
|
||||
field5 = ArrayList()
|
||||
field7++
|
||||
field8++
|
||||
field9 = null
|
||||
field10 = null
|
||||
}
|
||||
|
||||
internal interface I
|
||||
|
||||
private val anonymous: I = object : I {
|
||||
|
||||
}
|
||||
@@ -43,6 +29,20 @@ internal class A {
|
||||
|
||||
private var iimpl = anonymous
|
||||
|
||||
fun foo(): String {
|
||||
return "x"
|
||||
}
|
||||
|
||||
fun bar() {
|
||||
field5 = ArrayList()
|
||||
field7++
|
||||
field8++
|
||||
field9 = null
|
||||
field10 = null
|
||||
}
|
||||
|
||||
internal interface I
|
||||
|
||||
fun testAnonymousObject(i: Any) {
|
||||
if (true) {
|
||||
iimpl = i as I
|
||||
|
||||
Reference in New Issue
Block a user