FIR: Add workaround for flatMap issue
This commit is contained in:
+1
-4
@@ -38,10 +38,7 @@ class FirOverloadByLambdaReturnTypeResolver(
|
|||||||
allCandidates: Collection<Candidate>,
|
allCandidates: Collection<Candidate>,
|
||||||
bestCandidates: Set<Candidate>
|
bestCandidates: Set<Candidate>
|
||||||
): Set<Candidate> where T : FirStatement, T : FirResolvable {
|
): Set<Candidate> where T : FirStatement, T : FirResolvable {
|
||||||
if (
|
if (bestCandidates.size <= 1) return bestCandidates
|
||||||
bestCandidates.size <= 1 ||
|
|
||||||
!session.languageVersionSettings.supportsFeature(LanguageFeature.OverloadResolutionByLambdaReturnType)
|
|
||||||
) return bestCandidates
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Inference session may look into candidate of call, and for that it uses callee reference.
|
* Inference session may look into candidate of call, and for that it uses callee reference.
|
||||||
|
|||||||
+5
-5
@@ -20,17 +20,17 @@ fun takeString(s: String) {}
|
|||||||
fun takeInt(s: Int) {}
|
fun takeInt(s: Int) {}
|
||||||
|
|
||||||
fun test_1() {
|
fun test_1() {
|
||||||
val x = <!AMBIGUITY!>create<!> { "" }
|
val x = create { "" }
|
||||||
takeString(x)
|
takeString(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun test_2() {
|
fun test_2() {
|
||||||
val x = <!AMBIGUITY!>create<!> { 1 }
|
val x = create { 1 }
|
||||||
takeInt(x)
|
takeInt(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun test_3() {
|
fun test_3() {
|
||||||
val x = <!AMBIGUITY!>create<!> { 1.0 }
|
val x = create { 1.0 }
|
||||||
}
|
}
|
||||||
|
|
||||||
@OverloadResolutionByLambdaReturnType
|
@OverloadResolutionByLambdaReturnType
|
||||||
@@ -38,11 +38,11 @@ fun <K> create(x: K, f: (K) -> Int): Int = 1
|
|||||||
fun <T> create(x: T, f: (T) -> String): String = ""
|
fun <T> create(x: T, f: (T) -> String): String = ""
|
||||||
|
|
||||||
fun test_4() {
|
fun test_4() {
|
||||||
val x = <!AMBIGUITY!>create<!>("") { "" }
|
val x = create("") { "" }
|
||||||
takeString(x)
|
takeString(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun test_5() {
|
fun test_5() {
|
||||||
val x = <!AMBIGUITY!>create<!>("") { 1 }
|
val x = create("") { 1 }
|
||||||
takeInt(x)
|
takeInt(x)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user