FIR: resolve conflicts around SAM calls properly
This commit is contained in:
-29
@@ -1,29 +0,0 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
// FILE: StaticOverrides.java
|
||||
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
|
||||
public class StaticOverrides {
|
||||
public static class A {
|
||||
public static int foo(Runnable x) { return 0; }
|
||||
public static boolean foo(Function0<Unit> x) { return true; }
|
||||
}
|
||||
|
||||
public static class B {
|
||||
public static String foo(Runnable x) { return ""; }
|
||||
}
|
||||
|
||||
public static class C extends A {
|
||||
public static String foo(Runnable x) { return ""; }
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
fun test() {
|
||||
StaticOverrides.A.<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!> {} <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { _<Boolean>() }
|
||||
StaticOverrides.B.foo {} checkType { _<String>() }
|
||||
StaticOverrides.C.<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!> {} <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { _<Boolean>() }
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !CHECK_TYPE
|
||||
|
||||
// FILE: StaticOverrides.java
|
||||
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// !CHECK_TYPE
|
||||
|
||||
// FILE: Foo.java
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
|
||||
class Foo {
|
||||
interface FObject<T> {
|
||||
void invoke(T i);
|
||||
}
|
||||
|
||||
public String foo(FObject<Integer> f) { return ""; }
|
||||
public int foo(Function1<Integer, Unit> f) { return 1; }
|
||||
|
||||
public String bar(FObject<Object> f) { return ""; }
|
||||
public int bar(Function1<Integer, Unit> f) { return 1; }
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
fun test() {
|
||||
Foo().<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!> {} <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { _<Int>() }
|
||||
Foo().<!OVERLOAD_RESOLUTION_AMBIGUITY!>bar<!> {} <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { _<String>() }
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// !CHECK_TYPE
|
||||
|
||||
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// !CHECK_TYPE
|
||||
|
||||
// FILE: Foo.java
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
|
||||
public class Foo {
|
||||
interface FObject {
|
||||
void invoke(Object i);
|
||||
}
|
||||
|
||||
public String test(FObject f) { return ""; }
|
||||
public int test(Function1<Integer, Unit> f) { return 1; }
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
fun bar() {
|
||||
Foo().<!OVERLOAD_RESOLUTION_AMBIGUITY!>test<!> {} <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { _<String>() }
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// !CHECK_TYPE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user