[FIR] Properly handle callable references which were resolved with error
This commit is contained in:
+2
-2
@@ -24,7 +24,7 @@ fun <T> Foo2<T>.setX(y: T): T {
|
||||
fun Float.bar() {}
|
||||
|
||||
fun test1() {
|
||||
val fooSetRef = <!DEBUG_INFO_EXPRESSION_TYPE("Type is unknown")!>Foo<*>::<!UNRESOLVED_REFERENCE!>setX<!><!>
|
||||
val fooSetRef = <!DEBUG_INFO_EXPRESSION_TYPE("ERROR CLASS: Unresolved reference: setX")!>Foo<*>::<!UNRESOLVED_REFERENCE!>setX<!><!>
|
||||
val foo = Foo<Float>(1f)
|
||||
|
||||
fooSetRef.<!UNRESOLVED_REFERENCE!>invoke<!>(foo, 1)
|
||||
@@ -42,7 +42,7 @@ fun test2() {
|
||||
}
|
||||
|
||||
fun test3() {
|
||||
val fooSetRef = <!DEBUG_INFO_EXPRESSION_TYPE("Type is unknown")!>Foo2<*>::<!UNRESOLVED_REFERENCE!>setX<!><!>
|
||||
val fooSetRef = <!DEBUG_INFO_EXPRESSION_TYPE("ERROR CLASS: Unresolved reference: setX")!>Foo2<*>::<!UNRESOLVED_REFERENCE!>setX<!><!>
|
||||
val foo = Foo2<Int>(1)
|
||||
|
||||
fooSetRef.<!UNRESOLVED_REFERENCE!>invoke<!>(foo, "")
|
||||
|
||||
@@ -84,14 +84,14 @@ fun <T : Foo, R: Number, D: Int> main() {
|
||||
bar1(::resolve) // OK
|
||||
|
||||
// with LHS and conflicting projection
|
||||
bar2<T>(Foo::<!UNRESOLVED_REFERENCE!>resolve<!>)
|
||||
bar2<Foo>(Foo::<!UNRESOLVED_REFERENCE!>resolve<!>)
|
||||
bar2(Foo::<!UNRESOLVED_REFERENCE!>resolve<!>)
|
||||
bar2<T>(Foo::<!OVERLOAD_RESOLUTION_AMBIGUITY!>resolve<!>)
|
||||
bar2<Foo>(Foo::<!OVERLOAD_RESOLUTION_AMBIGUITY!>resolve<!>)
|
||||
bar2(Foo::<!OVERLOAD_RESOLUTION_AMBIGUITY!>resolve<!>)
|
||||
|
||||
// with LHS and Any? expected type
|
||||
bar3<T>(Foo::<!UNRESOLVED_REFERENCE!>resolve<!>)
|
||||
bar3<Foo>(Foo::<!UNRESOLVED_REFERENCE!>resolve<!>)
|
||||
bar3(Foo::<!UNRESOLVED_REFERENCE!>resolve<!>)
|
||||
bar3<T>(Foo::<!OVERLOAD_RESOLUTION_AMBIGUITY!>resolve<!>)
|
||||
bar3<Foo>(Foo::<!OVERLOAD_RESOLUTION_AMBIGUITY!>resolve<!>)
|
||||
bar3(Foo::<!OVERLOAD_RESOLUTION_AMBIGUITY!>resolve<!>)
|
||||
|
||||
// with LHS and `Function` expected type
|
||||
bar4<T>(Foo::resolve) // ERROR before the fix in NI
|
||||
|
||||
+1
-1
@@ -12,5 +12,5 @@ fun <V, T : V?> G<T>.foo(vararg values: V2<V?>) = build()
|
||||
fun forReference(ref: Any?) {}
|
||||
|
||||
fun test() {
|
||||
forReference(G<Int?>::<!UNRESOLVED_REFERENCE!>foo<!>)
|
||||
forReference(G<Int?>::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>)
|
||||
}
|
||||
|
||||
+4
-4
@@ -6,10 +6,10 @@ fun main1() = when {
|
||||
else -> Foo::<!UNRESOLVED_REFERENCE!>plus<!>
|
||||
}
|
||||
|
||||
fun main2() = if (true) Foo::minus else Foo::times
|
||||
fun main2() = if (true) Foo::<!UNRESOLVED_REFERENCE!>minus<!> else Foo::<!UNRESOLVED_REFERENCE!>times<!>
|
||||
|
||||
fun main3() = if (true) { Foo::minus } else { Foo::times }
|
||||
fun main3() = if (true) { Foo::<!UNRESOLVED_REFERENCE!>minus<!> } else { Foo::<!UNRESOLVED_REFERENCE!>times<!> }
|
||||
|
||||
fun main4() = try { Foo::minus } finally { Foo::<!UNRESOLVED_REFERENCE!>times<!> }
|
||||
fun main4() = try { Foo::<!UNRESOLVED_REFERENCE!>minus<!> } finally { Foo::<!UNRESOLVED_REFERENCE!>times<!> }
|
||||
|
||||
fun main5() = Foo::minus ?: Foo::times
|
||||
fun main5() = Foo::<!UNRESOLVED_REFERENCE!>minus<!> ?: Foo::<!UNRESOLVED_REFERENCE!>times<!>
|
||||
|
||||
+19
-19
@@ -29,13 +29,13 @@ fun poll11(flag: Boolean) {
|
||||
}
|
||||
|
||||
fun poll12(flag: Boolean) {
|
||||
val inv = if (flag) { ::bar3 } else { ::foo3 }
|
||||
val inv = if (flag) { ::<!UNRESOLVED_REFERENCE!>bar3<!> } else { ::<!UNRESOLVED_REFERENCE!>foo3<!> }
|
||||
inv(<!NO_VALUE_FOR_PARAMETER!>)<!>
|
||||
}
|
||||
|
||||
fun poll13(flag: Boolean) {
|
||||
val inv = if (flag) { ::bar2 } else { ::foo3 }
|
||||
inv(<!NO_VALUE_FOR_PARAMETER!>)<!>
|
||||
val inv = if (flag) { ::bar2 } else { ::<!UNRESOLVED_REFERENCE!>foo3<!> }
|
||||
inv()
|
||||
}
|
||||
|
||||
fun poll14(flag: Boolean) {
|
||||
@@ -44,7 +44,7 @@ fun poll14(flag: Boolean) {
|
||||
}
|
||||
|
||||
fun poll15(flag: Boolean) {
|
||||
val inv = if (flag) { ::bar5 } else { ::foo5 }
|
||||
val inv = if (flag) { ::<!UNRESOLVED_REFERENCE!>bar5<!> } else { ::<!UNRESOLVED_REFERENCE!>foo5<!> }
|
||||
inv(<!NO_VALUE_FOR_PARAMETER!>)<!>
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ fun poll17(flag: Boolean) {
|
||||
}
|
||||
|
||||
fun poll2(flag: Boolean) {
|
||||
val inv = when (flag) { true -> ::bar else -> ::foo }
|
||||
val inv = when (flag) { true -> ::<!UNRESOLVED_REFERENCE!>bar<!> else -> ::<!UNRESOLVED_REFERENCE!>foo<!> }
|
||||
inv(<!NO_VALUE_FOR_PARAMETER!>)<!>
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ fun poll21(flag: Boolean) {
|
||||
}
|
||||
|
||||
fun poll22(flag: Boolean) {
|
||||
val inv = when (flag) { true -> ::bar3 else -> ::foo3 }
|
||||
val inv = when (flag) { true -> ::<!UNRESOLVED_REFERENCE!>bar3<!> else -> ::<!UNRESOLVED_REFERENCE!>foo3<!> }
|
||||
inv(<!NO_VALUE_FOR_PARAMETER!>)<!>
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ fun poll23(flag: Boolean) {
|
||||
}
|
||||
|
||||
fun poll24(flag: Boolean) {
|
||||
val inv = when (flag) { true -> ::bar5 else -> ::foo5 }
|
||||
val inv = when (flag) { true -> ::<!UNRESOLVED_REFERENCE!>bar5<!> else -> ::<!UNRESOLVED_REFERENCE!>foo5<!> }
|
||||
inv
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ fun poll26(flag: Boolean) {
|
||||
}
|
||||
|
||||
fun poll3(flag: Boolean) {
|
||||
val inv = when (flag) { true -> ::bar false -> ::foo }
|
||||
val inv = when (flag) { true -> ::<!UNRESOLVED_REFERENCE!>bar<!> false -> ::<!UNRESOLVED_REFERENCE!>foo<!> }
|
||||
inv(<!NO_VALUE_FOR_PARAMETER!>)<!>
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ fun poll31(flag: Boolean) {
|
||||
}
|
||||
|
||||
fun poll32(flag: Boolean) {
|
||||
val inv = when (flag) { true -> ::bar3 false -> ::foo3 }
|
||||
val inv = when (flag) { true -> ::<!UNRESOLVED_REFERENCE!>bar3<!> false -> ::<!UNRESOLVED_REFERENCE!>foo3<!> }
|
||||
inv(<!NO_VALUE_FOR_PARAMETER!>)<!>
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ fun poll33(flag: Boolean) {
|
||||
}
|
||||
|
||||
fun poll34(flag: Boolean) {
|
||||
val inv = when (flag) { true -> ::bar5 false -> ::foo5 }
|
||||
val inv = when (flag) { true -> ::<!UNRESOLVED_REFERENCE!>bar5<!> false -> ::<!UNRESOLVED_REFERENCE!>foo5<!> }
|
||||
inv
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ fun poll36(flag: Boolean) {
|
||||
}
|
||||
|
||||
fun poll4() {
|
||||
val inv = try { ::bar } finally { ::<!UNRESOLVED_REFERENCE!>foo<!> }
|
||||
val inv = try { ::<!UNRESOLVED_REFERENCE!>bar<!> } finally { ::<!UNRESOLVED_REFERENCE!>foo<!> }
|
||||
inv(<!NO_VALUE_FOR_PARAMETER!>)<!>
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ fun poll41() {
|
||||
}
|
||||
|
||||
fun poll42() {
|
||||
val inv = try { ::bar3 } finally { ::<!UNRESOLVED_REFERENCE!>foo3<!> }
|
||||
val inv = try { ::<!UNRESOLVED_REFERENCE!>bar3<!> } finally { ::<!UNRESOLVED_REFERENCE!>foo3<!> }
|
||||
inv(<!NO_VALUE_FOR_PARAMETER!>)<!>
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ fun poll43() {
|
||||
}
|
||||
|
||||
fun poll44() {
|
||||
val inv = try { ::bar5 } finally { ::<!UNRESOLVED_REFERENCE!>foo5<!> }
|
||||
val inv = try { ::<!UNRESOLVED_REFERENCE!>bar5<!> } finally { ::<!UNRESOLVED_REFERENCE!>foo5<!> }
|
||||
inv(<!NO_VALUE_FOR_PARAMETER!>)<!>
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ fun poll46() {
|
||||
}
|
||||
|
||||
fun poll5() {
|
||||
val inv = try { ::bar } catch (e: Exception) { ::foo } finally { ::<!UNRESOLVED_REFERENCE!>foo<!> }
|
||||
val inv = try { ::<!UNRESOLVED_REFERENCE!>bar<!> } catch (e: Exception) { ::<!UNRESOLVED_REFERENCE!>foo<!> } finally { ::<!UNRESOLVED_REFERENCE!>foo<!> }
|
||||
inv(<!NO_VALUE_FOR_PARAMETER!>)<!>
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ fun poll51() {
|
||||
}
|
||||
|
||||
fun poll52() {
|
||||
val inv = try { ::bar3 } catch (e: Exception) { ::foo3 } finally { ::<!UNRESOLVED_REFERENCE!>foo3<!> }
|
||||
val inv = try { ::<!UNRESOLVED_REFERENCE!>bar3<!> } catch (e: Exception) { ::<!UNRESOLVED_REFERENCE!>foo3<!> } finally { ::<!UNRESOLVED_REFERENCE!>foo3<!> }
|
||||
inv(<!NO_VALUE_FOR_PARAMETER!>)<!>
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ fun poll53() {
|
||||
}
|
||||
|
||||
fun poll54() {
|
||||
val inv = try { ::bar5 } catch (e: Exception) { ::foo5 } finally { ::<!UNRESOLVED_REFERENCE!>foo5<!> }
|
||||
val inv = try { ::<!UNRESOLVED_REFERENCE!>bar5<!> } catch (e: Exception) { ::<!UNRESOLVED_REFERENCE!>foo5<!> } finally { ::<!UNRESOLVED_REFERENCE!>foo5<!> }
|
||||
inv(<!NO_VALUE_FOR_PARAMETER!>)<!>
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ fun poll66() {
|
||||
}
|
||||
|
||||
fun poll7() {
|
||||
val inv = ::bar<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
|
||||
val inv = ::<!UNRESOLVED_REFERENCE!>bar<!><!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
|
||||
inv(<!NO_VALUE_FOR_PARAMETER!>)<!>
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ fun poll71() {
|
||||
}
|
||||
|
||||
fun poll72() {
|
||||
val inv = ::bar3<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
|
||||
val inv = ::<!UNRESOLVED_REFERENCE!>bar3<!><!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
|
||||
inv(<!NO_VALUE_FOR_PARAMETER!>)<!>
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@ fun poll73() {
|
||||
}
|
||||
|
||||
fun poll74() {
|
||||
val inv = ::bar5<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
|
||||
val inv = ::<!UNRESOLVED_REFERENCE!>bar5<!><!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
|
||||
inv
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user