FIR: support DefinitelyNotNull types
#KT-49465 Fixed
This commit is contained in:
+27
@@ -485,6 +485,33 @@ class FirTypeResolverImpl(private val session: FirSession) : FirTypeResolver() {
|
||||
}
|
||||
is FirFunctionTypeRef -> createFunctionalType(typeRef) to null
|
||||
is FirDynamicTypeRef -> ConeKotlinErrorType(ConeUnsupportedDynamicType()) to null
|
||||
is FirIntersectionTypeRef -> {
|
||||
val (leftType, leftDiagnostic) = resolveType(
|
||||
typeRef.leftType
|
||||
?: return ConeKotlinErrorType(ConeSimpleDiagnostic("Problem during processing intersection type")) to null,
|
||||
scopeClassDeclaration,
|
||||
areBareTypesAllowed,
|
||||
isOperandOfIsOperator,
|
||||
useSiteFile,
|
||||
supertypeSupplier
|
||||
)
|
||||
val (rightType, _) = resolveType(
|
||||
typeRef.rightType
|
||||
?: return ConeKotlinErrorType(ConeSimpleDiagnostic("Problem during processing intersection type")) to null,
|
||||
scopeClassDeclaration,
|
||||
areBareTypesAllowed,
|
||||
isOperandOfIsOperator,
|
||||
useSiteFile,
|
||||
supertypeSupplier
|
||||
)
|
||||
|
||||
if (rightType.isAny && leftType is ConeTypeParameterType) {
|
||||
ConeDefinitelyNotNullType(leftType) to leftDiagnostic //how properly concat (leftDiagnostic + rightDiagnostic)?
|
||||
} else {
|
||||
ConeKotlinErrorType(ConeUnsupported("Intersection types are not supported yet", typeRef.source)) to null
|
||||
}
|
||||
|
||||
}
|
||||
else -> error(typeRef.render())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user