FIR: handle labeled super reference properly

This commit is contained in:
Jinseong Jeon
2020-04-30 23:37:37 -07:00
committed by Mikhail Glukhikh
parent 260683c20e
commit 7b01cf7b04
32 changed files with 141 additions and 299 deletions
@@ -7,16 +7,16 @@ interface Trait {
class Outer : Trait {
class Nested {
val t = this@Outer.bar()
val s = super@Outer.<!UNRESOLVED_REFERENCE!>bar<!>()
val s = super@Outer.bar()
inner class NestedInner {
val t = this@Outer.bar()
val s = super@Outer.<!UNRESOLVED_REFERENCE!>bar<!>()
val s = super@Outer.bar()
}
}
inner class Inner {
val t = this@Outer.bar()
val s = super@Outer.<!UNRESOLVED_REFERENCE!>bar<!>()
val s = super@Outer.bar()
}
}
@@ -13,10 +13,10 @@ class Outer : Trait {
inner class Inner {
val t = this@Local
val s = super@Local.<!UNRESOLVED_REFERENCE!>bar<!>()
val s = super@Local.bar()
val tt = this@Outer
val ss = super@Outer.<!UNRESOLVED_REFERENCE!>bar<!>()
val ss = super@Outer.bar()
}
}
}
+10 -10
View File
@@ -24,7 +24,7 @@ interface KotlinInterface : JavaInterface {
object {
fun run () {
super@KotlinInterface.<!UNRESOLVED_REFERENCE!>test<!>()
super@KotlinInterface.test()
}
}
}
@@ -35,7 +35,7 @@ interface KotlinInterface : JavaInterface {
object {
fun run () {
super@KotlinInterface.<!UNRESOLVED_REFERENCE!>test<!>()
super@KotlinInterface.test()
}
}
return ""
@@ -53,7 +53,7 @@ interface KotlinInterfaceIndirectInheritance : KotlinInterface {
object {
fun run () {
super@KotlinInterfaceIndirectInheritance.<!UNRESOLVED_REFERENCE!>test<!>()
super@KotlinInterfaceIndirectInheritance.test()
}
}
}
@@ -64,7 +64,7 @@ interface KotlinInterfaceIndirectInheritance : KotlinInterface {
object {
fun run () {
super@KotlinInterfaceIndirectInheritance.<!UNRESOLVED_REFERENCE!>test<!>()
super@KotlinInterfaceIndirectInheritance.test()
}
}
return ""
@@ -79,7 +79,7 @@ open class KotlinClass : JavaInterface {
object {
fun run () {
super@KotlinClass.<!UNRESOLVED_REFERENCE!>test<!>()
super@KotlinClass.test()
}
}
}
@@ -91,7 +91,7 @@ open class KotlinClass : JavaInterface {
object {
fun run () {
super@KotlinClass.<!UNRESOLVED_REFERENCE!>test<!>()
super@KotlinClass.test()
}
}
return ""
@@ -106,7 +106,7 @@ class KotlinClassIndirectInheritance : KotlinClass() {
object {
fun run () {
super@KotlinClassIndirectInheritance.<!UNRESOLVED_REFERENCE!>test<!>()
super@KotlinClassIndirectInheritance.test()
}
}
}
@@ -118,7 +118,7 @@ class KotlinClassIndirectInheritance : KotlinClass() {
object {
fun run () {
super@KotlinClassIndirectInheritance.<!UNRESOLVED_REFERENCE!>test<!>()
super@KotlinClassIndirectInheritance.test()
}
}
return ""
@@ -133,7 +133,7 @@ class KotlinClassIndirectInheritance2 : KotlinInterfaceIndirectInheritance {
object {
fun run () {
super@KotlinClassIndirectInheritance2.<!UNRESOLVED_REFERENCE!>test<!>()
super@KotlinClassIndirectInheritance2.test()
}
}
}
@@ -145,7 +145,7 @@ class KotlinClassIndirectInheritance2 : KotlinInterfaceIndirectInheritance {
object {
fun run () {
super@KotlinClassIndirectInheritance2.<!UNRESOLVED_REFERENCE!>test<!>()
super@KotlinClassIndirectInheritance2.test()
}
}
return ""
@@ -26,7 +26,7 @@ interface KotlinInterface : JavaInterface {
object {
fun run () {
super@KotlinInterface.<!UNRESOLVED_REFERENCE!>test<!>()
super@KotlinInterface.test()
}
}
}
@@ -37,7 +37,7 @@ interface KotlinInterface : JavaInterface {
object {
fun run () {
super@KotlinInterface.<!UNRESOLVED_REFERENCE!>test<!>()
super@KotlinInterface.test()
}
}
return ""
@@ -55,7 +55,7 @@ interface KotlinInterfaceIndirectInheritance : KotlinInterface {
object {
fun run () {
super@KotlinInterfaceIndirectInheritance.<!UNRESOLVED_REFERENCE!>test<!>()
super@KotlinInterfaceIndirectInheritance.test()
}
}
}
@@ -66,7 +66,7 @@ interface KotlinInterfaceIndirectInheritance : KotlinInterface {
object {
fun run () {
super@KotlinInterfaceIndirectInheritance.<!UNRESOLVED_REFERENCE!>test<!>()
super@KotlinInterfaceIndirectInheritance.test()
}
}
return ""
@@ -81,7 +81,7 @@ open class KotlinClass : JavaInterface {
object {
fun run () {
super@KotlinClass.<!UNRESOLVED_REFERENCE!>test<!>()
super@KotlinClass.test()
}
}
}
@@ -93,7 +93,7 @@ open class KotlinClass : JavaInterface {
object {
fun run () {
super@KotlinClass.<!UNRESOLVED_REFERENCE!>test<!>()
super@KotlinClass.test()
}
}
return ""
@@ -108,7 +108,7 @@ class KotlinClassIndirectInheritance : KotlinClass() {
object {
fun run () {
super@KotlinClassIndirectInheritance.<!UNRESOLVED_REFERENCE!>test<!>()
super@KotlinClassIndirectInheritance.test()
}
}
}
@@ -120,7 +120,7 @@ class KotlinClassIndirectInheritance : KotlinClass() {
object {
fun run () {
super@KotlinClassIndirectInheritance.<!UNRESOLVED_REFERENCE!>test<!>()
super@KotlinClassIndirectInheritance.test()
}
}
return ""
@@ -135,7 +135,7 @@ class KotlinClassIndirectInheritance2 : KotlinInterfaceIndirectInheritance {
object {
fun run () {
super@KotlinClassIndirectInheritance2.<!UNRESOLVED_REFERENCE!>test<!>()
super@KotlinClassIndirectInheritance2.test()
}
}
}
@@ -147,7 +147,7 @@ class KotlinClassIndirectInheritance2 : KotlinInterfaceIndirectInheritance {
object {
fun run () {
super@KotlinClassIndirectInheritance2.<!UNRESOLVED_REFERENCE!>test<!>()
super@KotlinClassIndirectInheritance2.test()
}
}
return ""
@@ -7,6 +7,6 @@ class A {
constructor(x: Any?)
constructor() : this(object {
fun bar() = <!UNRESOLVED_REFERENCE!>foo<!>() + this@A.<!UNRESOLVED_REFERENCE!>foo<!>() +
<!INAPPLICABLE_CANDIDATE!>foobar<!>() + super@A.hashCode()
<!INAPPLICABLE_CANDIDATE!>foobar<!>() + super@A.<!UNRESOLVED_REFERENCE!>hashCode<!>()
})
}
@@ -31,7 +31,7 @@ class A<E>() : C(), T {
fun test() {
super<T>.foo();
<!NOT_A_SUPERTYPE!>super<C><!>.bar()
<!NOT_A_SUPERTYPE!>super<C>@A<!>.bar()
super<C>@A.bar()
super<T>@A.foo()
super<T>@B.foo()
<!NOT_A_SUPERTYPE!>super<C>@B<!>.<!UNRESOLVED_REFERENCE!>foo<!>()
@@ -1,33 +0,0 @@
open class A {
open fun foo() {}
}
interface B {
fun bar() {}
}
interface Q {
fun qux() {}
}
class C : A(), B {
override fun foo() {
super@C.foo()
}
override fun bar() {
super@C.bar()
}
inner class D : A(), Q {
override fun foo() {
super@C.foo()
super@D.foo()
}
override fun qux() {
super@C.qux()
super@D.qux()
}
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
open class A {
open fun foo() {}
}