[FIR] Fix missing receiver type if anonymous function without label

This commit is contained in:
simon.ogorodnik
2020-04-07 23:43:42 +03:00
parent d2fd377605
commit f573719cc1
143 changed files with 249 additions and 766 deletions
@@ -11,26 +11,26 @@ public class A {
// FILE: 1.kt
fun fn() {}
fun x(a: A, r: Runnable) {
a.foo(::fn) checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
a.foo {} checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
a.foo(::fn) checkType { _<Int>() }
a.foo {} checkType { _<Int>() }
a.foo(null) checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
a.foo(Runnable { }) checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
a.foo(r) checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
a.foo(null) checkType { _<Int>() }
a.foo(Runnable { }) checkType { _<Int>() }
a.foo(r) checkType { _<Int>() }
a.foo(123) checkType { <!UNRESOLVED_REFERENCE!>_<!><String>() }
a.foo("") checkType { <!UNRESOLVED_REFERENCE!>_<!><String>() }
a.foo(123) checkType { _<String>() }
a.foo("") checkType { _<String>() }
a.bar(::fn) checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
a.bar {} checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
a.bar(::fn) checkType { _<Int>() }
a.bar {} checkType { _<Int>() }
a.bar(r) checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
a.bar(r) checkType { _<Int>() }
a.<!AMBIGUITY!>bar<!>(null)
a.bar(null as Runnable?) checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
a.bar(null as CharSequence?) checkType { <!UNRESOLVED_REFERENCE!>_<!><String>() }
a.bar(null as Runnable?) checkType { _<Int>() }
a.bar(null as CharSequence?) checkType { _<String>() }
a.bar("") checkType { <!UNRESOLVED_REFERENCE!>_<!><String>() }
a.bar("") checkType { _<String>() }
a.<!INAPPLICABLE_CANDIDATE!>bar<!>(123)
}
@@ -11,26 +11,26 @@ public class A {
// FILE: 1.kt
fun fn() {}
fun x(r: Runnable) {
A.foo(::fn) checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
A.foo {} checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
A.foo(::fn) checkType { _<Int>() }
A.foo {} checkType { _<Int>() }
A.foo(null) checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
A.foo(Runnable { }) checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
A.foo(r) checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
A.foo(null) checkType { _<Int>() }
A.foo(Runnable { }) checkType { _<Int>() }
A.foo(r) checkType { _<Int>() }
A.foo(123) checkType { <!UNRESOLVED_REFERENCE!>_<!><String>() }
A.foo("") checkType { <!UNRESOLVED_REFERENCE!>_<!><String>() }
A.foo(123) checkType { _<String>() }
A.foo("") checkType { _<String>() }
A.bar(::fn) checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
A.bar {} checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
A.bar(::fn) checkType { _<Int>() }
A.bar {} checkType { _<Int>() }
A.bar(r) checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
A.bar(r) checkType { _<Int>() }
A.<!AMBIGUITY!>bar<!>(null)
A.bar(null as Runnable?) checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
A.bar(null as CharSequence?) checkType { <!UNRESOLVED_REFERENCE!>_<!><String>() }
A.bar(null as Runnable?) checkType { _<Int>() }
A.bar(null as CharSequence?) checkType { _<String>() }
A.bar("") checkType { <!UNRESOLVED_REFERENCE!>_<!><String>() }
A.bar("") checkType { _<String>() }
A.<!INAPPLICABLE_CANDIDATE!>bar<!>(123)
}
@@ -12,26 +12,26 @@ public class A {
// FILE: 1.kt
fun fn() {}
fun x(r: Runnable) {
A.foo(::fn) checkType { <!UNRESOLVED_REFERENCE!>_<!><String>() }
A.foo {} checkType { <!UNRESOLVED_REFERENCE!>_<!><String>() }
A.foo(::fn) checkType { <!INAPPLICABLE_CANDIDATE!>_<!><String>() }
A.foo {} checkType { <!INAPPLICABLE_CANDIDATE!>_<!><String>() }
A.foo(null) checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
A.foo(Runnable { }) checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
A.foo(r) checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
A.foo(null) checkType { _<Int>() }
A.foo(Runnable { }) checkType { _<Int>() }
A.foo(r) checkType { _<Int>() }
A.foo(123) checkType { <!UNRESOLVED_REFERENCE!>_<!><String>() }
A.foo("") checkType { <!UNRESOLVED_REFERENCE!>_<!><String>() }
A.foo(123) checkType { _<String>() }
A.foo("") checkType { _<String>() }
A.bar(::fn) checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
A.bar {} checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
A.bar(::fn) checkType { _<Int>() }
A.bar {} checkType { _<Int>() }
A.bar(r) checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
A.bar(r) checkType { _<Int>() }
A.<!AMBIGUITY!>bar<!>(null)
A.bar(null as Runnable?) checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
A.bar(null as CharSequence?) checkType { <!UNRESOLVED_REFERENCE!>_<!><String>() }
A.bar(null as Runnable?) checkType { _<Int>() }
A.bar(null as CharSequence?) checkType { _<String>() }
A.bar("") checkType { <!UNRESOLVED_REFERENCE!>_<!><String>() }
A.bar("") checkType { _<String>() }
A.<!INAPPLICABLE_CANDIDATE!>bar<!>(123)
}
@@ -12,26 +12,26 @@ public class A {
// FILE: 1.kt
fun fn() {}
fun x(a: A, r: Runnable) {
a.foo(::fn) checkType { <!UNRESOLVED_REFERENCE!>_<!><String>() }
a.foo {} checkType { <!UNRESOLVED_REFERENCE!>_<!><String>() }
a.foo(::fn) checkType { <!INAPPLICABLE_CANDIDATE!>_<!><String>() }
a.foo {} checkType { <!INAPPLICABLE_CANDIDATE!>_<!><String>() }
a.foo(null) checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
a.foo(Runnable { }) checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
a.foo(r) checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
a.foo(null) checkType { _<Int>() }
a.foo(Runnable { }) checkType { _<Int>() }
a.foo(r) checkType { _<Int>() }
a.foo(123) checkType { <!UNRESOLVED_REFERENCE!>_<!><String>() }
a.foo("") checkType { <!UNRESOLVED_REFERENCE!>_<!><String>() }
a.foo(123) checkType { _<String>() }
a.foo("") checkType { _<String>() }
a.bar(::fn) checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
a.bar {} checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
a.bar(::fn) checkType { _<Int>() }
a.bar {} checkType { _<Int>() }
a.bar(r) checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
a.bar(r) checkType { _<Int>() }
a.<!AMBIGUITY!>bar<!>(null)
a.bar(null as Runnable?) checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
a.bar(null as CharSequence?) checkType { <!UNRESOLVED_REFERENCE!>_<!><String>() }
a.bar(null as Runnable?) checkType { _<Int>() }
a.bar(null as CharSequence?) checkType { _<String>() }
a.bar("") checkType { <!UNRESOLVED_REFERENCE!>_<!><String>() }
a.bar("") checkType { _<String>() }
a.<!INAPPLICABLE_CANDIDATE!>bar<!>(123)
}