[FE] Don't check intersection emptiness if there were lower constraints
This commit is contained in:
committed by
teamcity
parent
d4d45a8410
commit
73be9d0a20
@@ -583,7 +583,11 @@ internal object CheckIncompatibleTypeVariableUpperBounds : ResolutionStage() {
|
||||
for (variableWithConstraints in candidate.system.notFixedTypeVariables.values) {
|
||||
val upperTypes = variableWithConstraints.constraints.extractUpperTypesToCheckIntersectionEmptiness()
|
||||
|
||||
if (upperTypes.computeEmptyIntersectionTypeKind().isDefinitelyEmpty()) {
|
||||
// TODO: consider reporting errors on bounded type variables by incompatible types but with other lower constraints
|
||||
if (
|
||||
variableWithConstraints.constraints.none { it.kind.isLower() }
|
||||
&& upperTypes.computeEmptyIntersectionTypeKind().isDefinitelyEmpty()
|
||||
) {
|
||||
sink.yieldDiagnostic(
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
InferredEmptyIntersectionDiagnostic(
|
||||
|
||||
Reference in New Issue
Block a user