[FE 1.0] Substituted possible fixed type variables after completion in accordance with @OverloadResolutionByLambdaReturnType
^KT-48031 Fixed
This commit is contained in:
committed by
teamcity
parent
5b5da025f4
commit
3ed87c29c7
+6
@@ -14333,6 +14333,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
runTest("compiler/testData/diagnostics/tests/inference/builderInference/kt47986_4.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt48031.kt")
|
||||
public void testKt48031() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/builderInference/kt48031.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt49285.kt")
|
||||
public void testKt49285() throws Exception {
|
||||
|
||||
+6
@@ -14333,6 +14333,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
||||
runTest("compiler/testData/diagnostics/tests/inference/builderInference/kt47986_4.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt48031.kt")
|
||||
public void testKt48031() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/builderInference/kt48031.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt49285.kt")
|
||||
public void testKt49285() throws Exception {
|
||||
|
||||
@@ -53,6 +53,7 @@ import org.jetbrains.kotlin.resolve.ForbiddenNamedArgumentsTarget
|
||||
import org.jetbrains.kotlin.resolve.calls.tower.CandidateApplicability
|
||||
import org.jetbrains.kotlin.types.ConstantValueKind
|
||||
import org.jetbrains.kotlin.types.SmartcastStability
|
||||
import org.jetbrains.kotlin.types.model.safeSubstitute
|
||||
import org.jetbrains.kotlin.utils.addIfNotNull
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
@@ -488,7 +489,9 @@ fun BodyResolveComponents.initialTypeOfCandidate(candidate: Candidate): ConeKotl
|
||||
}
|
||||
|
||||
private fun initialTypeOfCandidate(candidate: Candidate, typeRef: FirResolvedTypeRef): ConeKotlinType {
|
||||
return candidate.substitutor.substituteOrSelf(typeRef.type)
|
||||
val system = candidate.system
|
||||
val resultingSubstitutor = system.buildCurrentSubstitutor()
|
||||
return resultingSubstitutor.safeSubstitute(system, candidate.substitutor.substituteOrSelf(typeRef.type)) as ConeKotlinType
|
||||
}
|
||||
|
||||
fun FirCallableDeclaration.getContainingClass(session: FirSession): FirRegularClass? =
|
||||
|
||||
Reference in New Issue
Block a user