IR: slightly fix kotlin-like dumping of super qualifiers

This commit is contained in:
Mikhail Glukhikh
2022-06-15 12:04:59 +02:00
committed by Space
parent b0a6508d4b
commit 8ae47d4c4d
35 changed files with 95 additions and 68 deletions
@@ -13,16 +13,17 @@ class C : B {
fun f(): @FlexibleNullability String? {
return eval<@FlexibleNullability String?>(f = local fun <anonymous>(): @FlexibleNullability String? {
return <this>super.#x
return <this>(super<A>).#x
}
)
}
fun g(): @FlexibleNullability String? {
return eval<@FlexibleNullability String?>(f = local fun <anonymous>(): @FlexibleNullability String? {
return <this>super.#y
return <this>(super<B>).#y
}
)
}
}
@@ -13,16 +13,17 @@ class C : B {
fun f(): @FlexibleNullability String? {
return eval<@FlexibleNullability String?>(f = local fun <anonymous>(): @FlexibleNullability String? {
return <this>super.#x
return <this>(super<A>).#x
}
)
}
fun g(): @FlexibleNullability String? {
return eval<@FlexibleNullability String?>(f = local fun <anonymous>(): @FlexibleNullability String? {
return <this>super.#y
return <this>(super<B>).#y
}
)
}
}
@@ -11,17 +11,18 @@ fun test2(mc: MutableCollection<String>) {
fun test3() {
{ // BLOCK
val tmp0_safe_receiver: @FlexibleNullability PrintStream? = super.#out
val tmp0_safe_receiver: @FlexibleNullability PrintStream? = super<System>.#out
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> tmp0_safe_receiver /*!! PrintStream */.println(p0 = "Hello,")
}
} /*~> Unit */
{ // BLOCK
val tmp1_safe_receiver: @FlexibleNullability PrintStream? = super.#out
val tmp1_safe_receiver: @FlexibleNullability PrintStream? = super<System>.#out
when {
EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null
else -> tmp1_safe_receiver /*!! PrintStream */.println(p0 = "world!")
}
} /*~> Unit */
}
+3 -2
View File
@@ -7,9 +7,10 @@ fun testEquals(a: Int, b: Int): Boolean {
}
fun testJEqeqNull(): Boolean {
return EQEQ(arg0 = super.#INT_NULL, arg1 = null)
return EQEQ(arg0 = super<J>.#INT_NULL, arg1 = null)
}
fun testJEqualsNull(): Boolean {
return super.#INT_NULL /*!! Int */.equals(other = null)
return super<J>.#INT_NULL /*!! Int */.equals(other = null)
}
@@ -55,7 +55,7 @@ fun test(b: Boolean) {
else -> d2
}
k.#f = 42
ksuper.#f /*~> Unit */
k(super<JFieldOwner>).#f /*~> Unit */
val md1: DerivedThroughMid1 = DerivedThroughMid1()
val md2: DerivedThroughMid2 = DerivedThroughMid2()
val mk: Mid = when {
@@ -63,5 +63,6 @@ fun test(b: Boolean) {
else -> md2
}
mk.#f = 44
mksuper.#f /*~> Unit */
mk(super<JFieldOwner>).#f /*~> Unit */
}
@@ -54,14 +54,15 @@ fun test(b: Boolean) {
b -> d1
else -> d2
}
k /*as JFieldOwner */super.#f = 42
k /*as JFieldOwner */super.#f /*~> Unit */
k /*as JFieldOwner */(super<JFieldOwner>).#f = 42
k /*as JFieldOwner */(super<JFieldOwner>).#f /*~> Unit */
val md1: DerivedThroughMid1 = DerivedThroughMid1()
val md2: DerivedThroughMid2 = DerivedThroughMid2()
val mk: Any = when {
b -> md1
else -> md2
}
mk /*as Mid */super.#f = 44
mk /*as Mid */super.#f /*~> Unit */
mk /*as Mid */(super<Mid>).#f = 44
mk /*as Mid */(super<JFieldOwner>).#f /*~> Unit */
}
@@ -10,7 +10,7 @@ class Derived : Base {
}
fun getValue(): Int {
return <this>super.#value
return <this>(super<Base>).#value
}
fun setValue(value: Int) {
@@ -18,3 +18,4 @@ class Derived : Base {
}
}
@@ -6,15 +6,16 @@ class Derived : Base {
}
init {
<this>super.#value = 0
<this>(super<Derived>).#value = 0
}
fun getValue(): Int {
return <this>super.#value
return <this>(super<Base>).#value
}
fun setValue(value: Int) {
<this>super.#value = value
<this>(super<Derived>).#value = value
}
}
@@ -1,14 +1,14 @@
fun testFun() {
super.#out /*!! PrintStream */.println(p0 = "testFun")
super<System>.#out /*!! PrintStream */.println(p0 = "testFun")
}
var testProp: Any
get(): Any {
super.#out /*!! PrintStream */.println(p0 = "testProp/get")
super<System>.#out /*!! PrintStream */.println(p0 = "testProp/get")
return 42
}
set(value: Any) {
super.#out /*!! PrintStream */.println(p0 = "testProp/set")
super<System>.#out /*!! PrintStream */.println(p0 = "testProp/set")
}
class TestClass {
@@ -21,14 +21,15 @@ class TestClass {
val test: Int
field = when {
else -> { // BLOCK
super.#out /*!! PrintStream */.println(p0 = "TestClass/test")
super<System>.#out /*!! PrintStream */.println(p0 = "TestClass/test")
42
}
}
get
init {
super.#out /*!! PrintStream */.println(p0 = "TestClass/init")
super<System>.#out /*!! PrintStream */.println(p0 = "TestClass/init")
}
}
+2 -1
View File
@@ -53,7 +53,8 @@ class Test2 : J {
}
init {
<this>super.#field = 42
<this>(super<Test2>).#field = 42
}
}
@@ -8,9 +8,10 @@ class Derived : Base {
fun setValue(v: Any) {
when {
v is String -> { // BLOCK
<this>super.#value = v /*as String */
<this>(super<Derived>).#value = v /*as String */
}
}
}
}