[FE 1.0] Return to the old type intersection emptiness check
This reverts commit 8227c4b603.
#KT-53656 Fixed
This commit is contained in:
+2
@@ -48,6 +48,8 @@ interface KotlinResolutionStatelessCallbacks {
|
||||
fun isBuilderInferenceCall(argument: KotlinCallArgument, parameter: ValueParameterDescriptor): Boolean
|
||||
fun isApplicableCallForBuilderInference(descriptor: CallableDescriptor, languageVersionSettings: LanguageVersionSettings): Boolean
|
||||
|
||||
fun isOldIntersectionIsEmpty(types: Collection<KotlinType>): Boolean
|
||||
|
||||
fun createConstraintSystemForOverloadResolution(
|
||||
constraintInjector: ConstraintInjector, builtIns: KotlinBuiltIns
|
||||
): SimpleConstraintSystem
|
||||
|
||||
+3
-2
@@ -29,6 +29,7 @@ import org.jetbrains.kotlin.types.error.ErrorUtils
|
||||
import org.jetbrains.kotlin.types.model.*
|
||||
import org.jetbrains.kotlin.types.typeUtil.*
|
||||
import org.jetbrains.kotlin.utils.SmartList
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.cast
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.compactIfPossible
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
||||
|
||||
@@ -900,8 +901,8 @@ internal object CheckIncompatibleTypeVariableUpperBounds : ResolutionPart() {
|
||||
* Check if the candidate was already discriminated by `CompatibilityOfTypeVariableAsIntersectionTypePart` resolution part
|
||||
* If it's true we shouldn't mark the candidate with warning, but should mark with error, to repeat the existing proper behaviour
|
||||
*/
|
||||
private fun wasPreviouslyDiscriminated(upperTypes: List<KotlinTypeMarker>) =
|
||||
isEmptyIntersectionTypeCompatible(*upperTypes.toTypedArray())
|
||||
private fun ResolutionCandidate.wasPreviouslyDiscriminated(upperTypes: List<KotlinTypeMarker>) =
|
||||
callComponents.statelessCallbacks.isOldIntersectionIsEmpty(upperTypes.cast())
|
||||
|
||||
override fun ResolutionCandidate.process(workIndex: Int) = with(getSystem().asConstraintSystemCompleterContext()) {
|
||||
val constraintSystem = getSystem()
|
||||
|
||||
Reference in New Issue
Block a user