[FE] Check if type variable is fixed into an empty intersection type and report resolution warnings/errors if needed (completion stage)
^KT-51221 Fixed
This commit is contained in:
committed by
teamcity
parent
8e834fc7bb
commit
9e9e0211eb
+3
-1
@@ -61,7 +61,9 @@ class BuilderInferenceSession(
|
||||
psiCallResolver, postponedArgumentsAnalyzer, kotlinConstraintSystemCompleter, callComponents, builtIns
|
||||
) {
|
||||
private lateinit var lambda: ResolvedLambdaAtom
|
||||
private val commonSystem = NewConstraintSystemImpl(callComponents.constraintInjector, builtIns, callComponents.kotlinTypeRefiner)
|
||||
private val commonSystem = NewConstraintSystemImpl(
|
||||
callComponents.constraintInjector, builtIns, callComponents.kotlinTypeRefiner, topLevelCallContext.languageVersionSettings
|
||||
)
|
||||
|
||||
init {
|
||||
if (topLevelCallContext.inferenceSession is StubTypesBasedInferenceSession<*>) {
|
||||
|
||||
+3
-2
@@ -103,8 +103,9 @@ class KotlinResolutionCallbacksImpl(
|
||||
) as KotlinType
|
||||
}
|
||||
|
||||
override fun createEmptyConstraintSystem(): NewConstraintSystem =
|
||||
NewConstraintSystemImpl(callComponents.constraintInjector, callComponents.builtIns, callComponents.kotlinTypeRefiner)
|
||||
override fun createEmptyConstraintSystem(): NewConstraintSystem = NewConstraintSystemImpl(
|
||||
callComponents.constraintInjector, callComponents.builtIns, callComponents.kotlinTypeRefiner, callComponents.languageVersionSettings
|
||||
)
|
||||
|
||||
override fun resolveCallableReferenceArgument(
|
||||
argument: CallableReferenceKotlinCallArgument,
|
||||
|
||||
+1
-1
@@ -113,7 +113,7 @@ class KotlinResolutionStatelessCallbacksImpl(
|
||||
constraintInjector: ConstraintInjector, builtIns: KotlinBuiltIns
|
||||
): SimpleConstraintSystem {
|
||||
return if (languageVersionSettings.getFlag(AnalysisFlags.constraintSystemForOverloadResolution).forNewInference())
|
||||
SimpleConstraintSystemImpl(constraintInjector, builtIns, kotlinTypeRefiner)
|
||||
SimpleConstraintSystemImpl(constraintInjector, builtIns, kotlinTypeRefiner, languageVersionSettings)
|
||||
else
|
||||
ConstraintSystemBuilderImpl.forSpecificity()
|
||||
}
|
||||
|
||||
+5
-2
@@ -120,7 +120,9 @@ abstract class StubTypesBasedInferenceSession<D : CallableDescriptor>(
|
||||
|
||||
for (callInfo in listOf(goodCandidate, badCandidate)) {
|
||||
val atomsToAnalyze = mutableListOf<ResolvedAtom>(callInfo.callResolutionResult)
|
||||
val system = NewConstraintSystemImpl(callComponents.constraintInjector, builtIns, callComponents.kotlinTypeRefiner).apply {
|
||||
val system = NewConstraintSystemImpl(
|
||||
callComponents.constraintInjector, builtIns, callComponents.kotlinTypeRefiner, callComponents.languageVersionSettings
|
||||
).apply {
|
||||
addOtherSystem(callInfo.callResolutionResult.constraintSystem.getBuilder().currentStorage())
|
||||
/*
|
||||
* This is needed for very stupid case, when we have some delegate with good `getValue` and bad `setValue` that
|
||||
@@ -159,7 +161,8 @@ abstract class StubTypesBasedInferenceSession<D : CallableDescriptor>(
|
||||
val commonSystem = NewConstraintSystemImpl(
|
||||
callComponents.constraintInjector,
|
||||
builtIns,
|
||||
callComponents.kotlinTypeRefiner
|
||||
callComponents.kotlinTypeRefiner,
|
||||
callComponents.languageVersionSettings
|
||||
).apply {
|
||||
addOtherSystem(currentConstraintSystem())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user