[FE] Relax the "no subtyping between context receivers" limitation
This commit is contained in:
committed by
TeamCityServer
parent
bfd20e1890
commit
1f6746dc74
+2
-2
@@ -4,10 +4,10 @@ context(Collection<P>) class B<P>
|
||||
|
||||
fun Int.foo() {
|
||||
A<Int>()
|
||||
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>A<!><String>()
|
||||
<!NO_CONTEXT_RECEIVER!>A<String>()<!>
|
||||
}
|
||||
|
||||
fun Collection<Int>.bar() {
|
||||
B<Int>()
|
||||
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>B<!><String>()
|
||||
<!NO_CONTEXT_RECEIVER!>B<String>()<!>
|
||||
}
|
||||
@@ -14,28 +14,28 @@ fun <T> f(lazy1: Lazy<Int>, lazy2: Lazy<CharSequence>, lazyT: Lazy<T>, lazyLazyT
|
||||
with(lazy2) {
|
||||
test1()
|
||||
test2()
|
||||
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>test3<!>()
|
||||
<!NO_CONTEXT_RECEIVER!><!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>test3<!>()<!>
|
||||
}
|
||||
}
|
||||
with(lazy2) {
|
||||
with(lazy1) {
|
||||
test1()
|
||||
test2()
|
||||
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>test3<!>()
|
||||
<!NO_CONTEXT_RECEIVER!><!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>test3<!>()<!>
|
||||
}
|
||||
}
|
||||
with(lazyT) {
|
||||
with(lazy1) {
|
||||
<!NO_CONTEXT_RECEIVER!>test1()<!>
|
||||
test2()
|
||||
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>test3<!>()
|
||||
<!NO_CONTEXT_RECEIVER!><!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>test3<!>()<!>
|
||||
}
|
||||
}
|
||||
with(lazyLazyT) {
|
||||
with(lazy1) {
|
||||
<!NO_CONTEXT_RECEIVER!>test1()<!>
|
||||
test2()
|
||||
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>test3<!>()
|
||||
test3()
|
||||
}
|
||||
}
|
||||
with(lazy1) {
|
||||
|
||||
+1
-1
@@ -7,5 +7,5 @@ context(T)
|
||||
fun <T> T.f(t: B<T>) {}
|
||||
|
||||
fun Int.main(a: A, b: B<String>) {
|
||||
a.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>f<!>(b)
|
||||
a.<!NO_CONTEXT_RECEIVER!>f(<!TYPE_MISMATCH!>b<!>)<!>
|
||||
}
|
||||
+1
-1
@@ -12,6 +12,6 @@ fun main() {
|
||||
A<Int>().f()
|
||||
}
|
||||
with(listOf("1", "2", "3")) {
|
||||
A<Int>().<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>f<!>()
|
||||
A<Int>().<!NO_CONTEXT_RECEIVER!>f()<!>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user