[Tests] Add missing and fix incorrect
This commit is contained in:
committed by
TeamCityServer
parent
f92ac6ca14
commit
b0a7be72e8
+8
-8
@@ -8,38 +8,38 @@ class R {
|
||||
|
||||
context(C)
|
||||
fun R.f1(g: context(C) R.(Param) -> Unit) {
|
||||
g(this@C, this@R, Param())
|
||||
g(this<!UNRESOLVED_LABEL!>@C<!>, this<!UNRESOLVED_LABEL!>@R<!>, <!TOO_MANY_ARGUMENTS!>Param()<!>)
|
||||
}
|
||||
|
||||
context(C)
|
||||
fun f2(g: context(C) (Param) -> Unit) {
|
||||
g(this@C, Param())
|
||||
g(this<!UNRESOLVED_LABEL!>@C<!>, Param())
|
||||
}
|
||||
|
||||
context(C)
|
||||
fun R.f3(g: context(C) R.() -> Unit) {
|
||||
g(this@C, this@R)
|
||||
g(this<!UNRESOLVED_LABEL!>@C<!>, <!TOO_MANY_ARGUMENTS!>this<!UNRESOLVED_LABEL!>@R<!><!>)
|
||||
}
|
||||
|
||||
context(C)
|
||||
fun f4(g: context(C) () -> Unit) {
|
||||
g(this@C)
|
||||
g(this<!UNRESOLVED_LABEL!>@C<!>)
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val lf1: context(C) R.(Param) -> Unit = { _ ->
|
||||
r
|
||||
c
|
||||
<!UNRESOLVED_REFERENCE!>c<!>
|
||||
}
|
||||
val lf2: context(C) (Param) -> Unit = { _ ->
|
||||
c
|
||||
<!UNRESOLVED_REFERENCE!>c<!>
|
||||
}
|
||||
val lf3: context(C) R.() -> Unit = {
|
||||
r
|
||||
c
|
||||
<!UNRESOLVED_REFERENCE!>c<!>
|
||||
}
|
||||
val lf4: context(C) () -> Unit = {
|
||||
c
|
||||
<!UNRESOLVED_REFERENCE!>c<!>
|
||||
}
|
||||
|
||||
with(C()) {
|
||||
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
class A
|
||||
class B
|
||||
class C
|
||||
|
||||
context(A) fun B.f() {}
|
||||
context(A) fun B.g() {
|
||||
f()
|
||||
}
|
||||
context(A) fun C.h() {
|
||||
<!INAPPLICABLE_CANDIDATE!>f<!>()
|
||||
}
|
||||
|
||||
fun A.q(b: B) {
|
||||
with(b) {
|
||||
f()
|
||||
}
|
||||
<!INAPPLICABLE_CANDIDATE!>f<!>()
|
||||
}
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
|
||||
class A
|
||||
class B
|
||||
class C
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ class B : A() {
|
||||
inner class C {
|
||||
fun g() {
|
||||
super@B.f()
|
||||
super@Context.<!UNRESOLVED_REFERENCE!>h<!>()
|
||||
super<!UNRESOLVED_LABEL!>@Context<!>.h()
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
class A(val a: String?)
|
||||
|
||||
context(A) fun f() {
|
||||
if (<!UNRESOLVED_LABEL!>this@A<!>.<!UNRESOLVED_REFERENCE!>a<!> == null) return
|
||||
<!UNRESOLVED_LABEL!>this@A<!>.<!UNRESOLVED_REFERENCE!>a<!>.length
|
||||
if (this<!UNRESOLVED_LABEL!>@A<!>.a == null) return
|
||||
this<!UNRESOLVED_LABEL!>@A<!>.a.length
|
||||
}
|
||||
+9
-9
@@ -3,19 +3,19 @@ class B(val b: Any)
|
||||
class C(val c: Any)
|
||||
|
||||
context(labelAInt@A<Int>, A<String>, labelB@B) fun f() {
|
||||
<!UNRESOLVED_LABEL!>this@labelAInt<!>.<!UNRESOLVED_REFERENCE!>a<!>.toFloat()
|
||||
<!UNRESOLVED_LABEL!>this@A<!>.<!UNRESOLVED_REFERENCE!>a<!>.length
|
||||
<!UNRESOLVED_LABEL!>this@labelB<!>.<!UNRESOLVED_REFERENCE!>b<!>
|
||||
<!UNRESOLVED_LABEL!>this@B<!>
|
||||
this<!UNRESOLVED_LABEL!>@labelAInt<!>.a.toFloat()
|
||||
this<!UNRESOLVED_LABEL!>@A<!>.a.length
|
||||
this<!UNRESOLVED_LABEL!>@labelB<!>.b
|
||||
this<!UNRESOLVED_LABEL!>@B<!>
|
||||
}
|
||||
|
||||
context(labelAInt@A<Int>, A<String>, labelB@B) val C.p: Int
|
||||
get() {
|
||||
<!UNRESOLVED_LABEL!>this@labelAInt<!>.<!UNRESOLVED_REFERENCE!>a<!>.toFloat()
|
||||
<!UNRESOLVED_LABEL!>this@A<!>.<!UNRESOLVED_REFERENCE!>a<!>.length
|
||||
<!UNRESOLVED_LABEL!>this@B<!>
|
||||
<!UNRESOLVED_LABEL!>this@labelB<!>.<!UNRESOLVED_REFERENCE!>b<!>
|
||||
<!UNRESOLVED_LABEL!>this@C<!>.<!UNRESOLVED_REFERENCE!>c<!>
|
||||
this<!UNRESOLVED_LABEL!>@labelAInt<!>.a.toFloat()
|
||||
this<!UNRESOLVED_LABEL!>@A<!>.a.length
|
||||
this<!UNRESOLVED_LABEL!>@B<!>
|
||||
this<!UNRESOLVED_LABEL!>@labelB<!>.b
|
||||
this<!UNRESOLVED_LABEL!>@C<!>.c
|
||||
this@p.c
|
||||
this.c
|
||||
return 1
|
||||
|
||||
compiler/testData/diagnostics/tests/extensions/contextReceivers/thisWithReceiverLabelsClasses.fir.kt
Vendored
+2
-2
@@ -3,7 +3,7 @@ class A {
|
||||
}
|
||||
|
||||
context(A) class B {
|
||||
val prop = <!UNRESOLVED_REFERENCE!>x<!> + <!UNRESOLVED_LABEL!>this@A<!>.<!UNRESOLVED_REFERENCE!>x<!>
|
||||
val prop = <!UNRESOLVED_REFERENCE!>x<!> + this<!UNRESOLVED_LABEL!>@A<!>.x
|
||||
|
||||
fun f() = <!UNRESOLVED_REFERENCE!>x<!> + <!UNRESOLVED_LABEL!>this@A<!>.<!UNRESOLVED_REFERENCE!>x<!>
|
||||
fun f() = <!UNRESOLVED_REFERENCE!>x<!> + this<!UNRESOLVED_LABEL!>@A<!>.x
|
||||
}
|
||||
+5
-5
@@ -3,15 +3,15 @@ class B(val b: Any)
|
||||
class C(val c: Any)
|
||||
|
||||
context(A<Int>, A<String>, B) fun f() {
|
||||
<!UNRESOLVED_LABEL!>this@A<!>.<!UNRESOLVED_REFERENCE!>a<!>.length
|
||||
<!UNRESOLVED_LABEL!>this@B<!>.<!UNRESOLVED_REFERENCE!>b<!>
|
||||
this<!UNRESOLVED_LABEL!>@A<!>.a.length
|
||||
this<!UNRESOLVED_LABEL!>@B<!>.b
|
||||
<!NO_THIS!>this<!>
|
||||
}
|
||||
|
||||
context(A<Int>, A<String>, B) fun C.f() {
|
||||
<!UNRESOLVED_LABEL!>this@A<!>.<!UNRESOLVED_REFERENCE!>a<!>.length
|
||||
<!UNRESOLVED_LABEL!>this@B<!>.<!UNRESOLVED_REFERENCE!>b<!>
|
||||
<!UNRESOLVED_LABEL!>this@C<!>.<!UNRESOLVED_REFERENCE!>c<!>
|
||||
this<!UNRESOLVED_LABEL!>@A<!>.a.length
|
||||
this<!UNRESOLVED_LABEL!>@B<!>.b
|
||||
this<!UNRESOLVED_LABEL!>@C<!>.c
|
||||
this@f.c
|
||||
this.c
|
||||
}
|
||||
+8
-8
@@ -4,24 +4,24 @@ class C(val c: Any)
|
||||
|
||||
<!MUST_BE_INITIALIZED!>context(A<Int>, A<String>, B) var p: Int<!>
|
||||
get() {
|
||||
<!UNRESOLVED_LABEL!>this@A<!>.<!UNRESOLVED_REFERENCE!>a<!>.toDouble()
|
||||
<!UNRESOLVED_LABEL!>this@A<!>.<!UNRESOLVED_REFERENCE!>a<!>.length
|
||||
<!UNRESOLVED_LABEL!>this@B<!>.<!UNRESOLVED_REFERENCE!>b<!>
|
||||
this<!UNRESOLVED_LABEL!>@A<!>.a.toDouble()
|
||||
this<!UNRESOLVED_LABEL!>@A<!>.a.length
|
||||
this<!UNRESOLVED_LABEL!>@B<!>.b
|
||||
<!NO_THIS!>this<!>
|
||||
return 1
|
||||
}
|
||||
set(value) {
|
||||
<!UNRESOLVED_LABEL!>this@A<!>.<!UNRESOLVED_REFERENCE!>a<!>.length
|
||||
<!UNRESOLVED_LABEL!>this@B<!>.<!UNRESOLVED_REFERENCE!>b<!>
|
||||
this<!UNRESOLVED_LABEL!>@A<!>.a.length
|
||||
this<!UNRESOLVED_LABEL!>@B<!>.b
|
||||
<!NO_THIS!>this<!>
|
||||
field = value
|
||||
}
|
||||
|
||||
context(A<Int>, A<String>, B) val C.p: Int
|
||||
get() {
|
||||
<!UNRESOLVED_LABEL!>this@A<!>.<!UNRESOLVED_REFERENCE!>a<!>.length
|
||||
<!UNRESOLVED_LABEL!>this@B<!>.<!UNRESOLVED_REFERENCE!>b<!>
|
||||
<!UNRESOLVED_LABEL!>this@C<!>.<!UNRESOLVED_REFERENCE!>c<!>
|
||||
this<!UNRESOLVED_LABEL!>@A<!>.a.length
|
||||
this<!UNRESOLVED_LABEL!>@B<!>.b
|
||||
this<!UNRESOLVED_LABEL!>@C<!>.c
|
||||
this@p.c
|
||||
this.c
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user