FIR checker: fix position strategy for UNRESOLVED_LABEL
This commit is contained in:
committed by
Ivan Kochurkin
parent
45d31fdba2
commit
bcf6202863
@@ -6,11 +6,11 @@ interface Trait {
|
||||
|
||||
class Outer : Trait {
|
||||
class Nested {
|
||||
val t = <!UNRESOLVED_LABEL!>this@Outer<!>.<!UNRESOLVED_REFERENCE!>bar<!>()
|
||||
val t = this<!UNRESOLVED_LABEL!>@Outer<!>.<!UNRESOLVED_REFERENCE!>bar<!>()
|
||||
val s = super@Outer.<!UNRESOLVED_REFERENCE!>bar<!>()
|
||||
|
||||
inner class NestedInner {
|
||||
val t = <!UNRESOLVED_LABEL!>this@Outer<!>.<!UNRESOLVED_REFERENCE!>bar<!>()
|
||||
val t = this<!UNRESOLVED_LABEL!>@Outer<!>.<!UNRESOLVED_REFERENCE!>bar<!>()
|
||||
val s = super@Outer.<!UNRESOLVED_REFERENCE!>bar<!>()
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -7,8 +7,8 @@ class Outer {
|
||||
class Nested {
|
||||
fun f() = <!UNRESOLVED_REFERENCE!>function<!>()
|
||||
fun g() = <!UNRESOLVED_REFERENCE!>property<!>
|
||||
fun h() = <!UNRESOLVED_LABEL!>this@Outer<!>.<!UNRESOLVED_REFERENCE!>function<!>()
|
||||
fun i() = <!UNRESOLVED_LABEL!>this@Outer<!>.<!UNRESOLVED_REFERENCE!>property<!>
|
||||
fun h() = this<!UNRESOLVED_LABEL!>@Outer<!>.<!UNRESOLVED_REFERENCE!>function<!>()
|
||||
fun i() = this<!UNRESOLVED_LABEL!>@Outer<!>.<!UNRESOLVED_REFERENCE!>property<!>
|
||||
}
|
||||
|
||||
inner class Inner {
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
|
||||
val funLit = lambda@ fun String.() {
|
||||
val d1 = <!UNRESOLVED_LABEL!>this@lambda<!>
|
||||
val d1 = this<!UNRESOLVED_LABEL!>@lambda<!>
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val funLit = lambda@ fun String.(): <!UNRESOLVED_LABEL!>String<!> {
|
||||
return <!UNRESOLVED_LABEL!>this@lambda<!>
|
||||
return this<!UNRESOLVED_LABEL!>@lambda<!>
|
||||
}
|
||||
}
|
||||
|
||||
fun lambda() {
|
||||
val funLit = lambda@ fun String.(): <!UNRESOLVED_LABEL!>String<!> {
|
||||
return <!UNRESOLVED_LABEL!>this@lambda<!>
|
||||
return this<!UNRESOLVED_LABEL!>@lambda<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -4,10 +4,10 @@ interface Iterator<out T> {
|
||||
|
||||
fun <R> map(transform: (element: T) -> R) : Iterator<R> =
|
||||
object : Iterator<R> {
|
||||
override fun next() : R = transform(<!UNRESOLVED_LABEL!>this@map<!>.<!UNRESOLVED_REFERENCE!>next<!>())
|
||||
override fun next() : R = transform(this<!UNRESOLVED_LABEL!>@map<!>.<!UNRESOLVED_REFERENCE!>next<!>())
|
||||
|
||||
override val hasNext : Boolean
|
||||
// There's no 'this' associated with the map() function, only this of the Iterator class
|
||||
get() = <!UNRESOLVED_LABEL!>this@map<!>.<!UNRESOLVED_REFERENCE!>hasNext<!>
|
||||
get() = this<!UNRESOLVED_LABEL!>@map<!>.<!UNRESOLVED_REFERENCE!>hasNext<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ open class Base<T>(p: Any?) {
|
||||
class D: Base<Int>(1) {
|
||||
inner class B : Base<Int> {
|
||||
constructor() : super(foo1(1))
|
||||
constructor(x: Int) : super(<!UNRESOLVED_LABEL!>this@B<!>.<!UNRESOLVED_REFERENCE!>foo1<!>(1))
|
||||
constructor(x: Int) : super(this<!UNRESOLVED_LABEL!>@B<!>.<!UNRESOLVED_REFERENCE!>foo1<!>(1))
|
||||
constructor(x: Int, y: Int) : super(this@D.foo1(1))
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,6 +7,6 @@ fun Base.foo() {
|
||||
class B : Base {
|
||||
constructor() : super(foo1())
|
||||
constructor(x: Int) : super(this@foo.foo1())
|
||||
constructor(x: Int, y: Int) : super(<!UNRESOLVED_LABEL!>this@B<!>.<!UNRESOLVED_REFERENCE!>foo1<!>())
|
||||
constructor(x: Int, y: Int) : super(this<!UNRESOLVED_LABEL!>@B<!>.<!UNRESOLVED_REFERENCE!>foo1<!>())
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,6 +8,6 @@ fun Base<Int>.foo() {
|
||||
constructor() : super(foo1(<!ARGUMENT_TYPE_MISMATCH!>""<!>))
|
||||
constructor(x: Int) : super(foo1(1))
|
||||
constructor(x: Int, y: Int) : super(this@foo.foo1(12))
|
||||
constructor(x: Int, y: Int, z: Int) : super(<!UNRESOLVED_LABEL!>this@B<!>.<!UNRESOLVED_REFERENCE!>foo1<!>(""))
|
||||
constructor(x: Int, y: Int, z: Int) : super(this<!UNRESOLVED_LABEL!>@B<!>.<!UNRESOLVED_REFERENCE!>foo1<!>(""))
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -9,7 +9,7 @@ class A {
|
||||
{
|
||||
<!ARGUMENT_TYPE_MISMATCH, TYPE_MISMATCH!><!UNRESOLVED_REFERENCE!>foo<!>() +
|
||||
<!INSTANCE_ACCESS_BEFORE_SUPER_CALL!>this<!>.<!UNRESOLVED_REFERENCE!>foo<!>() +
|
||||
<!UNRESOLVED_LABEL!>this@A<!>.<!UNRESOLVED_REFERENCE!>foo<!>() +
|
||||
this<!UNRESOLVED_LABEL!>@A<!>.<!UNRESOLVED_REFERENCE!>foo<!>() +
|
||||
<!UNRESOLVED_REFERENCE!>foobar<!>()<!>
|
||||
})
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ class A {
|
||||
fun foo() = 1
|
||||
constructor(x: Any?)
|
||||
constructor() : this(object {
|
||||
fun bar() = <!UNRESOLVED_REFERENCE!>foo<!>() + <!UNRESOLVED_LABEL!>this@A<!>.<!UNRESOLVED_REFERENCE!>foo<!>() +
|
||||
fun bar() = <!UNRESOLVED_REFERENCE!>foo<!>() + this<!UNRESOLVED_LABEL!>@A<!>.<!UNRESOLVED_REFERENCE!>foo<!>() +
|
||||
<!INAPPLICABLE_CANDIDATE!>foobar<!>() + super@A.<!UNRESOLVED_REFERENCE!>hashCode<!>()
|
||||
})
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ fun A.foobar() = 3
|
||||
class A {
|
||||
fun foo() = 1
|
||||
constructor( x: Any = object {
|
||||
fun bar() = <!UNRESOLVED_REFERENCE!>foo<!>() + <!UNRESOLVED_LABEL!>this@A<!>.<!UNRESOLVED_REFERENCE!>foo<!>() +
|
||||
fun bar() = <!UNRESOLVED_REFERENCE!>foo<!>() + this<!UNRESOLVED_LABEL!>@A<!>.<!UNRESOLVED_REFERENCE!>foo<!>() +
|
||||
<!INAPPLICABLE_CANDIDATE!>foobar<!>()
|
||||
})
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -3,6 +3,6 @@ fun foo(x: A) = 1
|
||||
|
||||
class A {
|
||||
constructor(x: Int)
|
||||
constructor(x: Int, y: Int, z: Int = x + foo(<!INSTANCE_ACCESS_BEFORE_SUPER_CALL!>this<!>) + foo(<!UNRESOLVED_LABEL!>this@A<!>)) :
|
||||
this(x + foo(<!INSTANCE_ACCESS_BEFORE_SUPER_CALL!>this<!>) + foo(<!UNRESOLVED_LABEL!>this@A<!>))
|
||||
constructor(x: Int, y: Int, z: Int = x + foo(<!INSTANCE_ACCESS_BEFORE_SUPER_CALL!>this<!>) + foo(this<!UNRESOLVED_LABEL!>@A<!>)) :
|
||||
this(x + foo(<!INSTANCE_ACCESS_BEFORE_SUPER_CALL!>this<!>) + foo(this<!UNRESOLVED_LABEL!>@A<!>))
|
||||
}
|
||||
|
||||
+1
-1
@@ -10,6 +10,6 @@ class A {
|
||||
<!INSTANCE_ACCESS_BEFORE_SUPER_CALL!>this<!>.foobar() +
|
||||
<!UNRESOLVED_REFERENCE!>prop<!> +
|
||||
<!INSTANCE_ACCESS_BEFORE_SUPER_CALL!>this<!>.prop +
|
||||
<!UNRESOLVED_LABEL!>this@A<!>.prop<!>
|
||||
this<!UNRESOLVED_LABEL!>@A<!>.prop<!>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
class A() {
|
||||
fun foo() : Unit {
|
||||
this@A
|
||||
<!UNRESOLVED_LABEL!>this@a<!>
|
||||
this<!UNRESOLVED_LABEL!>@a<!>
|
||||
this
|
||||
}
|
||||
|
||||
val x = this@A.foo()
|
||||
val y = this.foo()
|
||||
val z = foo()
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -11,8 +11,8 @@ class A(val a:Int) {
|
||||
checkSubtype<A>(this@A)
|
||||
}
|
||||
val b: Double.() -> Unit = a@{ checkSubtype<Double>(this@a) + checkSubtype<Byte>(this@xx) }
|
||||
val c = a@{ -> <!UNRESOLVED_LABEL!>this@a<!> + checkSubtype<Byte>(this@xx) }
|
||||
val c = a@{ -> this<!UNRESOLVED_LABEL!>@a<!> + checkSubtype<Byte>(this@xx) }
|
||||
return (a@{checkSubtype<Double>(this@a) + checkSubtype<Byte>(this@xx)})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -3,6 +3,6 @@ interface Base {
|
||||
}
|
||||
val String.test: Base = <!EXTENSION_PROPERTY_WITH_BACKING_FIELD!>object<!>: Base {
|
||||
override fun foo() {
|
||||
<!UNRESOLVED_LABEL!>this@test<!>
|
||||
this<!UNRESOLVED_LABEL!>@test<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
fun foo1() : Unit {
|
||||
<!NO_THIS!>this<!>
|
||||
<!UNRESOLVED_LABEL!>this@a<!>
|
||||
}
|
||||
this<!UNRESOLVED_LABEL!>@a<!>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user