FIR: Fix scope intersection types
Otherwise overload resolution ambiguity is reported in the test
This commit is contained in:
Vendored
+1
-1
@@ -8,6 +8,6 @@ interface B {
|
||||
|
||||
fun test(c: Any) {
|
||||
if (c is B && c is A) {
|
||||
c.<!AMBIGUITY!>foo<!><String, Int>()
|
||||
c.foo<String, Int>()
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -10,6 +10,6 @@ interface B {
|
||||
|
||||
fun test(c: Any) {
|
||||
if (c is B && c is A) {
|
||||
c.<!AMBIGUITY!>foo<!>()
|
||||
c.foo()
|
||||
}
|
||||
}
|
||||
|
||||
+14
-14
@@ -17,37 +17,37 @@ interface C {
|
||||
|
||||
fun foo(x: Any?) {
|
||||
if (x is A && x is B) {
|
||||
x.<!AMBIGUITY!>foo<!>().<!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><String>() }
|
||||
x.<!AMBIGUITY!>foo<!>().<!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><String?>() }
|
||||
x.foo().checkType { <!INAPPLICABLE_CANDIDATE!>_<!><String>() }
|
||||
x.foo().checkType { _<String?>() }
|
||||
}
|
||||
|
||||
if (x is B && x is A) {
|
||||
x.<!AMBIGUITY!>foo<!>().<!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><String>() }
|
||||
x.<!AMBIGUITY!>foo<!>().<!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><String?>() }
|
||||
x.foo().checkType { <!INAPPLICABLE_CANDIDATE!>_<!><String>() }
|
||||
x.foo().checkType { _<String?>() }
|
||||
}
|
||||
|
||||
if (x is A && x is C) {
|
||||
x.<!AMBIGUITY!>foo<!>().<!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><String>() }
|
||||
x.<!AMBIGUITY!>foo<!>().<!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><String?>() }
|
||||
x.foo().checkType { _<String>() }
|
||||
x.foo().checkType { <!INAPPLICABLE_CANDIDATE!>_<!><String?>() }
|
||||
}
|
||||
|
||||
if (x is C && x is A) {
|
||||
x.<!AMBIGUITY!>foo<!>().<!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><String>() }
|
||||
x.<!AMBIGUITY!>foo<!>().<!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><String?>() }
|
||||
x.foo().checkType { _<String>() }
|
||||
x.foo().checkType { <!INAPPLICABLE_CANDIDATE!>_<!><String?>() }
|
||||
}
|
||||
|
||||
if (x is A && x is B && x is C) {
|
||||
x.<!AMBIGUITY!>foo<!>().<!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><String>() }
|
||||
x.<!AMBIGUITY!>foo<!>().<!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><String?>() }
|
||||
x.foo().checkType { _<String>() }
|
||||
x.foo().checkType { <!INAPPLICABLE_CANDIDATE!>_<!><String?>() }
|
||||
}
|
||||
|
||||
if (x is B && x is A && x is C) {
|
||||
x.<!AMBIGUITY!>foo<!>().<!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><String>() }
|
||||
x.<!AMBIGUITY!>foo<!>().<!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><String?>() }
|
||||
x.foo().checkType { _<String>() }
|
||||
x.foo().checkType { <!INAPPLICABLE_CANDIDATE!>_<!><String?>() }
|
||||
}
|
||||
|
||||
if (x is B && x is C && x is A) {
|
||||
x.<!AMBIGUITY!>foo<!>().<!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><String>() }
|
||||
x.<!AMBIGUITY!>foo<!>().<!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><String?>() }
|
||||
x.foo().checkType { _<String>() }
|
||||
x.foo().checkType { <!INAPPLICABLE_CANDIDATE!>_<!><String?>() }
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -14,6 +14,6 @@ interface B : Common {
|
||||
|
||||
fun test(c: Common) {
|
||||
if (c is B && c is A) {
|
||||
c.<!AMBIGUITY!>foo<!>().<!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><String>() }
|
||||
c.foo().checkType { _<String>() }
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -10,6 +10,6 @@ interface B {
|
||||
|
||||
fun test(c: Any) {
|
||||
if (c is B && c is A) {
|
||||
c.<!AMBIGUITY!>foo<!>().<!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><String>() }
|
||||
c.foo().checkType { _<String>() }
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -13,9 +13,9 @@ interface B: A {
|
||||
|
||||
fun test(a: A) {
|
||||
if (a is B && a is C) {
|
||||
a.<!AMBIGUITY!>foo<!> = ""
|
||||
a.<!AMBIGUITY!>foo<!> = null
|
||||
a.foo = ""
|
||||
a.foo = null
|
||||
|
||||
a.<!AMBIGUITY!>foo<!>.<!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><String>() }
|
||||
a.foo.checkType { _<String>() }
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -13,8 +13,8 @@ interface B: A {
|
||||
|
||||
fun test(a: A) {
|
||||
if (a is B && a is C) {
|
||||
a.<!AMBIGUITY!>foo<!> = ""
|
||||
a.<!AMBIGUITY!>foo<!> = null
|
||||
a.<!AMBIGUITY!>foo<!>
|
||||
a.foo = ""
|
||||
a.foo = null
|
||||
a.foo
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -28,11 +28,11 @@ fun test() {
|
||||
x.foo().checkType { _<CharSequence?>() }
|
||||
|
||||
if (x is B && x is C) {
|
||||
x.<!AMBIGUITY!>foo<!>().<!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><CharSequence?>() }
|
||||
x.foo().checkType { <!INAPPLICABLE_CANDIDATE!>_<!><CharSequence?>() }
|
||||
x.baz("")
|
||||
x.<!AMBIGUITY!>baz<!>(1).<!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><Unit>() }
|
||||
x.<!AMBIGUITY!>baz<!>(1, 2)
|
||||
x.baz(1).checkType { <!INAPPLICABLE_CANDIDATE!>_<!><Unit>() }
|
||||
x.baz(1, 2)
|
||||
|
||||
x.<!AMBIGUITY!>foobar<!>().<!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><String>() }
|
||||
x.foobar().checkType { _<String>() }
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -10,6 +10,6 @@ interface B {
|
||||
|
||||
fun test(c: Any) {
|
||||
if (c is B && c is A) {
|
||||
c.<!AMBIGUITY!>foo<!><String, Int>().<!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
|
||||
c.foo<String, Int>().checkType { _<Int>() }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user