FE 1.0: implement initial label resolve warning for KT-51433

This commit is contained in:
Mikhail Glukhikh
2022-02-22 11:11:45 +03:00
committed by Space
parent 31b234a261
commit b5e2c492c6
11 changed files with 191 additions and 22 deletions
@@ -0,0 +1,41 @@
fun Int.with() {
with("") {
<!ARGUMENT_TYPE_MISMATCH!>this@with.<!UNRESOLVED_REFERENCE!>inc<!>()<!>
}
}
fun Int.bar() {
with("") bar@{
<!ARGUMENT_TYPE_MISMATCH!>this@bar.<!UNRESOLVED_REFERENCE!>inc<!>()<!>
}
}
fun foo(f: with.() -> Unit) {}
class with {
fun foo() {
with("") {
<!ARGUMENT_TYPE_MISMATCH!>this@with.<!UNRESOLVED_REFERENCE!>foo<!>()<!>
}
with("") with@{
<!ARGUMENT_TYPE_MISMATCH!>this@with.<!UNRESOLVED_REFERENCE!>foo<!>()<!>
}
with("") other@{
this@with.foo()
}
}
}
private typealias Extension = TypedThis
class TypedThis {
fun TypedThis.baz() {
this@TypedThis
}
fun Extension.bar() {
this@TypedThis
}
}
@@ -0,0 +1,41 @@
fun Int.with() {
with("") {
this<!LABEL_RESOLVE_WILL_CHANGE("function with; anonymous function")!>@with<!>.inc()
}
}
fun Int.bar() {
with("") bar@{
this<!LABEL_RESOLVE_WILL_CHANGE!>@bar<!>.inc()
}
}
fun foo(f: with.() -> Unit) {}
class with {
fun foo() {
with("") {
this<!LABEL_RESOLVE_WILL_CHANGE("class with; anonymous function")!>@with<!>.foo()
}
with("") with@{
this<!LABEL_RESOLVE_WILL_CHANGE!>@with<!>.foo()
}
with("") other@{
this@with.foo()
}
}
}
private typealias Extension = TypedThis
class TypedThis {
fun TypedThis.baz() {
this@TypedThis
}
fun Extension.bar() {
this@TypedThis
}
}
@@ -0,0 +1,23 @@
package
public fun foo(/*0*/ f: with.() -> kotlin.Unit): kotlin.Unit
public fun kotlin.Int.bar(): kotlin.Unit
public fun kotlin.Int.with(): kotlin.Unit
public final class TypedThis {
public constructor TypedThis()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
public final fun Extension /* = TypedThis */.bar(): kotlin.Unit
public final fun TypedThis.baz(): kotlin.Unit
}
public final class with {
public constructor with()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public final fun foo(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
private typealias Extension = TypedThis