d3a0a6cabe
Before this commit, we discriminated particular candidates with callable reference adaptations during resolution stages. After disabling compatibility mode for new inference, it's not so, but now we discriminate similar candidates in ConeOverloadConflictResolver; more precisely, it's candidates with callable reference adaptation in their postponed atoms. This does not allow going up the tower, but allows to select better candidate at similar tower level. Related to KT-63558, KT-64307, KT-64308
26 lines
486 B
Kotlin
Vendored
26 lines
486 B
Kotlin
Vendored
// FILE: Callable.java
|
|
|
|
public interface Callable<V> {
|
|
V call() throws Exception;
|
|
}
|
|
|
|
// FILE: Future.java
|
|
|
|
public class Future<T> {}
|
|
|
|
// FILE: Executor.java
|
|
|
|
public interface Executor {
|
|
<T> Future<T> submit(Callable<T> task);
|
|
Future<?> submit(Runnable task);
|
|
}
|
|
|
|
// FILE: test.kt
|
|
|
|
fun f(): String = "test"
|
|
|
|
class A {
|
|
fun schedule1(e: Executor): Future<String> = e.submit(::f)
|
|
fun schedule2(e: Executor): Future<String> = <!RETURN_TYPE_MISMATCH!>e.submit { f() }<!>
|
|
}
|