Fix corner-cases in ConeTypeContext / FIR builder / FIR enhancements

This fixes a pack of FIR smoke diagnostic tests, now all of them pass
Related to KT-29962
This commit is contained in:
Mikhail Glukhikh
2019-03-14 16:43:36 +03:00
parent 8ea347653b
commit d65b30dd82
5 changed files with 42 additions and 26 deletions
@@ -146,7 +146,9 @@ private fun JavaClassifierType.enhanceInflexibleType(
mappedId = mappedId.readOnlyToMutable() ?: mappedId
}
}
session.service<FirSymbolProvider>().getClassLikeSymbolByFqName(mappedId ?: classId)!!
val kotlinClassId = mappedId ?: classId
session.service<FirSymbolProvider>().getClassLikeSymbolByFqName(kotlinClassId)
?: return ConeClassErrorType("Cannot find class-like symbol for $kotlinClassId during enhancement")
}
is JavaTypeParameter -> createTypeParameterSymbol(session, classifier.name)
else -> return toNotNullConeKotlinType(session)
@@ -198,6 +198,7 @@ class JavaClassEnhancementScope(
}
private fun StringBuilder.appendConeType(coneType: ConeKotlinType) {
if (coneType is ConeClassErrorType) return
append("L")
when (coneType) {
is ConeClassLikeType -> {