diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/FirOverloadByLambdaReturnTypeResolver.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/FirOverloadByLambdaReturnTypeResolver.kt index 536f1a9e888..d9a083f8d54 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/FirOverloadByLambdaReturnTypeResolver.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/FirOverloadByLambdaReturnTypeResolver.kt @@ -38,10 +38,7 @@ class FirOverloadByLambdaReturnTypeResolver( allCandidates: Collection, bestCandidates: Set ): Set where T : FirStatement, T : FirResolvable { - if ( - bestCandidates.size <= 1 || - !session.languageVersionSettings.supportsFeature(LanguageFeature.OverloadResolutionByLambdaReturnType) - ) return bestCandidates + if (bestCandidates.size <= 1) return bestCandidates /* * Inference session may look into candidate of call, and for that it uses callee reference. diff --git a/compiler/testData/diagnostics/testsWithStdLib/factoryPattern/overloadByLambdaReturnType_disabled.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/factoryPattern/overloadByLambdaReturnType_disabled.fir.kt index 51f9e0c49da..c24133ec13b 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/factoryPattern/overloadByLambdaReturnType_disabled.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/factoryPattern/overloadByLambdaReturnType_disabled.fir.kt @@ -20,17 +20,17 @@ fun takeString(s: String) {} fun takeInt(s: Int) {} fun test_1() { - val x = create { "" } + val x = create { "" } takeString(x) } fun test_2() { - val x = create { 1 } + val x = create { 1 } takeInt(x) } fun test_3() { - val x = create { 1.0 } + val x = create { 1.0 } } @OverloadResolutionByLambdaReturnType @@ -38,11 +38,11 @@ fun create(x: K, f: (K) -> Int): Int = 1 fun create(x: T, f: (T) -> String): String = "" fun test_4() { - val x = create("") { "" } + val x = create("") { "" } takeString(x) } fun test_5() { - val x = create("") { 1 } + val x = create("") { 1 } takeInt(x) }