FIR. Do not re-resolve parts of intersection types
This commit is contained in:
+3
-19
@@ -486,27 +486,11 @@ class FirTypeResolverImpl(private val session: FirSession) : FirTypeResolver() {
|
|||||||
is FirFunctionTypeRef -> createFunctionalType(typeRef) to null
|
is FirFunctionTypeRef -> createFunctionalType(typeRef) to null
|
||||||
is FirDynamicTypeRef -> ConeErrorType(ConeUnsupportedDynamicType()) to null
|
is FirDynamicTypeRef -> ConeErrorType(ConeUnsupportedDynamicType()) to null
|
||||||
is FirIntersectionTypeRef -> {
|
is FirIntersectionTypeRef -> {
|
||||||
val (leftType, leftDiagnostic) = resolveType(
|
val leftType = typeRef.leftType.coneType
|
||||||
typeRef.leftType
|
val rightType = typeRef.rightType.coneType
|
||||||
?: return ConeErrorType(ConeSimpleDiagnostic("Problem during processing intersection type")) to null,
|
|
||||||
scopeClassDeclaration,
|
|
||||||
areBareTypesAllowed,
|
|
||||||
isOperandOfIsOperator,
|
|
||||||
useSiteFile,
|
|
||||||
supertypeSupplier
|
|
||||||
)
|
|
||||||
val (rightType, _) = resolveType(
|
|
||||||
typeRef.rightType
|
|
||||||
?: return ConeErrorType(ConeSimpleDiagnostic("Problem during processing intersection type")) to null,
|
|
||||||
scopeClassDeclaration,
|
|
||||||
areBareTypesAllowed,
|
|
||||||
isOperandOfIsOperator,
|
|
||||||
useSiteFile,
|
|
||||||
supertypeSupplier
|
|
||||||
)
|
|
||||||
|
|
||||||
if (rightType.isAny && leftType is ConeTypeParameterType) {
|
if (rightType.isAny && leftType is ConeTypeParameterType) {
|
||||||
ConeDefinitelyNotNullType(leftType) to leftDiagnostic //how properly concat (leftDiagnostic + rightDiagnostic)?
|
ConeDefinitelyNotNullType(leftType) to null
|
||||||
} else {
|
} else {
|
||||||
ConeErrorType(ConeUnsupported("Intersection types are not supported yet", typeRef.source)) to null
|
ConeErrorType(ConeUnsupported("Intersection types are not supported yet", typeRef.source)) to null
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user