Files
kotlin-fork/compiler/testData/ir/irText/classes/delegatedImplementation.kt.txt
T
Alexander Udalov ffe0d9de70 Psi2ir: do not sort descriptors for fake override generation
Descriptors are already supposed to be sorted in scopes. The problem is
that rendering descriptors for sorting takes a lot of time (~1.5% of
total compilation time of intellij with JVM IR), and simple heuristics,
like comparing by names first, don't fully help with it.

 #KT-48233
2021-08-31 20:25:59 +02:00

150 lines
2.7 KiB
Plaintext
Vendored

interface IBase {
abstract fun foo(x: Int, s: String)
abstract fun bar(): Int
abstract fun String.qux()
}
object BaseImpl : IBase {
private constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
override fun foo(x: Int, s: String) {
}
override fun bar(): Int {
return 42
}
override fun String.qux() {
}
}
interface IOther {
abstract val x: String
abstract get
abstract var y: Int
abstract get
abstract set
abstract val Byte.z1: Int
abstract get
abstract var Byte.z2: Int
abstract get
abstract set
}
fun otherImpl(x0: String, y0: Int): IOther {
return { // BLOCK
local class <no name provided> : IOther {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
override val x: String
field = x0
override get
override var y: Int
field = y0
override get
override set
override val Byte.z1: Int
override get(): Int {
return 1
}
override var Byte.z2: Int
override get(): Int {
return 2
}
override set(value: Int) {
}
}
<no name provided>()
}
}
class Test1 : IBase {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
private /* final field */ val $$delegate_0: BaseImpl = BaseImpl
override fun bar(): Int {
return <this>.#$$delegate_0.bar()
}
override fun foo(x: Int, s: String) {
<this>.#$$delegate_0.foo(x = x, s = s)
}
override fun String.qux() {
(<this>.#$$delegate_0, <this>).qux()
}
}
class Test2 : IBase, IOther {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
private /* final field */ val $$delegate_0: BaseImpl = BaseImpl
override fun bar(): Int {
return <this>.#$$delegate_0.bar()
}
override fun foo(x: Int, s: String) {
<this>.#$$delegate_0.foo(x = x, s = s)
}
override fun String.qux() {
(<this>.#$$delegate_0, <this>).qux()
}
private /* final field */ val $$delegate_1: IOther = otherImpl(x0 = "", y0 = 42)
override val x: String
override get(): String {
return <this>.#$$delegate_1.<get-x>()
}
override var y: Int
override get(): Int {
return <this>.#$$delegate_1.<get-y>()
}
override set(<set-?>: Int) {
<this>.#$$delegate_1.<set-y>(<set-?> = <set-?>)
}
override val Byte.z1: Int
override get(): Int {
return (<this>.#$$delegate_1, <this>).<get-z1>()
}
override var Byte.z2: Int
override get(): Int {
return (<this>.#$$delegate_1, <this>).<get-z2>()
}
override set(<set-?>: Int) {
(<this>.#$$delegate_1, <this>).<set-z2>(<set-?> = <set-?>)
}
}