[FIR2IR] Rework reordering condition to better handle synthetic class delegation fields
^KT-60243 Merge-request: KT-MR-11125 Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
This commit is contained in:
committed by
Space Team
parent
66bbb9582c
commit
f7269eb384
+41
@@ -0,0 +1,41 @@
|
||||
package foo
|
||||
|
||||
interface Base {
|
||||
abstract fun foo(x: String): String
|
||||
}
|
||||
|
||||
class BaseImpl(val s: String) : Base {
|
||||
override fun foo(x: String): String = "Base: ${s}:${x}"
|
||||
}
|
||||
|
||||
var global = ""
|
||||
|
||||
open class DerivedBase() {
|
||||
init {
|
||||
global += ":DerivedBase"
|
||||
}
|
||||
}
|
||||
|
||||
fun newBase(): Base {
|
||||
global += ":newBase"
|
||||
return BaseImpl("test")
|
||||
}
|
||||
|
||||
class Derived() : DerivedBase(), Base by newBase() {
|
||||
init {
|
||||
global += ":Derived"
|
||||
}
|
||||
}
|
||||
|
||||
class Derived1() : Base by newBase(), DerivedBase() {
|
||||
init {
|
||||
global += ":Derived"
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var d = Derived()
|
||||
var d1 = Derived1()
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user