[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
-2
@@ -120,7 +120,8 @@ private inline fun Any?.errorMessage(): String {
|
||||
fun NewConstraintSystemImpl(
|
||||
constraintInjector: ConstraintInjector,
|
||||
builtIns: KotlinBuiltIns,
|
||||
kotlinTypeRefiner: KotlinTypeRefiner
|
||||
kotlinTypeRefiner: KotlinTypeRefiner,
|
||||
languageVersionSettings: LanguageVersionSettings
|
||||
): NewConstraintSystemImpl {
|
||||
return NewConstraintSystemImpl(constraintInjector, ClassicTypeSystemContextForCS(builtIns, kotlinTypeRefiner))
|
||||
return NewConstraintSystemImpl(constraintInjector, ClassicTypeSystemContextForCS(builtIns, kotlinTypeRefiner), languageVersionSettings)
|
||||
}
|
||||
|
||||
+2
-1
@@ -79,7 +79,8 @@ sealed class ResolutionCandidate : Candidate, KotlinDiagnosticsHolder {
|
||||
fun getSystem(): NewConstraintSystem {
|
||||
if (newSystem == null) {
|
||||
newSystem = NewConstraintSystemImpl(
|
||||
callComponents.constraintInjector, callComponents.builtIns, callComponents.kotlinTypeRefiner
|
||||
callComponents.constraintInjector, callComponents.builtIns,
|
||||
callComponents.kotlinTypeRefiner, callComponents.languageVersionSettings
|
||||
)
|
||||
if (baseSystem != null) {
|
||||
newSystem!!.addOtherSystem(baseSystem!!)
|
||||
|
||||
+6
-2
@@ -17,6 +17,7 @@
|
||||
package org.jetbrains.kotlin.resolve.calls.inference.components
|
||||
|
||||
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
|
||||
import org.jetbrains.kotlin.config.LanguageVersionSettings
|
||||
import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor
|
||||
import org.jetbrains.kotlin.resolve.calls.components.ClassicTypeSystemContextForCS
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.ConstraintSystemBuilder
|
||||
@@ -33,9 +34,12 @@ import org.jetbrains.kotlin.types.typeUtil.asTypeProjection
|
||||
class SimpleConstraintSystemImpl(
|
||||
constraintInjector: ConstraintInjector,
|
||||
builtIns: KotlinBuiltIns,
|
||||
kotlinTypeRefiner: KotlinTypeRefiner
|
||||
kotlinTypeRefiner: KotlinTypeRefiner,
|
||||
languageVersionSettings: LanguageVersionSettings
|
||||
) : SimpleConstraintSystem {
|
||||
val system = NewConstraintSystemImpl(constraintInjector, ClassicTypeSystemContextForCS(builtIns, kotlinTypeRefiner))
|
||||
val system = NewConstraintSystemImpl(
|
||||
constraintInjector, ClassicTypeSystemContextForCS(builtIns, kotlinTypeRefiner), languageVersionSettings
|
||||
)
|
||||
val csBuilder: ConstraintSystemBuilder =
|
||||
system.getBuilder()
|
||||
|
||||
|
||||
+4
-1
@@ -33,7 +33,10 @@ class SimpleCandidateFactory(
|
||||
val baseSystem: ConstraintStorage
|
||||
|
||||
init {
|
||||
val baseSystem = NewConstraintSystemImpl(callComponents.constraintInjector, callComponents.builtIns, callComponents.kotlinTypeRefiner)
|
||||
val baseSystem = NewConstraintSystemImpl(
|
||||
callComponents.constraintInjector, callComponents.builtIns,
|
||||
callComponents.kotlinTypeRefiner, callComponents.languageVersionSettings
|
||||
)
|
||||
if (!inferenceSession.resolveReceiverIndependently()) {
|
||||
baseSystem.addSubsystemFromArgument(kotlinCall.explicitReceiver)
|
||||
baseSystem.addSubsystemFromArgument(kotlinCall.dispatchReceiverForInvokeExtension)
|
||||
|
||||
Reference in New Issue
Block a user