[FIR] Add DNN checks

Merge-request: KT-MR-7000
Merged-by: Nikolay Lunyak <lunyak.kolya@mail.ru>
This commit is contained in:
Nikolay Lunyak
2022-09-01 14:25:07 +00:00
committed by Space
parent bb2bee74cf
commit 3d9c77efa8
16 changed files with 124 additions and 26 deletions
@@ -523,14 +523,11 @@ class FirTypeResolverImpl(private val session: FirSession) : FirTypeResolver() {
is FirDynamicTypeRef -> ConeDynamicType.create(session) to null
is FirIntersectionTypeRef -> {
val leftType = typeRef.leftType.coneType
val rightType = typeRef.rightType.coneType
if (rightType.isAny && leftType is ConeTypeParameterType) {
if (leftType is ConeTypeParameterType) {
ConeDefinitelyNotNullType(leftType) to null
} else {
ConeErrorType(ConeUnsupported("Intersection types are not supported yet", typeRef.source)) to null
ConeErrorType(ConeForbiddenIntersection) to null
}
}
else -> error(typeRef.render())
}