Remove isMarkedNullable from FirResolvedTypeRef

This commit is contained in:
Simon Ogorodnik
2019-04-25 18:15:44 +03:00
committed by Mikhail Glukhikh
parent 458080ca8b
commit 9cef9e4056
20 changed files with 65 additions and 74 deletions
@@ -218,8 +218,7 @@ class JavaSymbolProvider(
this@JavaSymbolProvider.session, null,
firSymbol.constructType(
classTypeParameters.map { ConeTypeParameterTypeImpl(it.symbol, false) }.toTypedArray(), false
),
false, emptyList()
)
)
).apply {
this.typeParameters += typeParameters
@@ -90,7 +90,7 @@ internal fun JavaClassifierType.toFirResolvedTypeRef(
): FirResolvedTypeRef {
val coneType = this.toConeKotlinTypeWithNullability(session, javaTypeParameterStack, isNullable = false)
return FirResolvedTypeRefImpl(
session, psi = null, type = coneType, isMarkedNullable = false,
session, psi = null, type = coneType,
annotations = annotations.map { it.toFirAnnotationCall(session, javaTypeParameterStack) }
)
}
@@ -173,7 +173,6 @@ internal fun JavaAnnotation.toFirAnnotationCall(
session,
psi = null,
type = ConeClassTypeImpl(FirClassSymbol(classId!!).toLookupTag(), emptyArray(), isNullable = false),
isMarkedNullable = true,
annotations = emptyList()
)
).apply {
@@ -312,7 +311,7 @@ private fun JavaType.toFirResolvedTypeRef(
if (this is JavaClassifierType) return toFirResolvedTypeRef(session, javaTypeParameterStack)
return FirResolvedTypeRefImpl(
session, psi = null, type = ConeClassErrorType("Unexpected JavaType: $this"),
isMarkedNullable = false, annotations = emptyList()
annotations = emptyList()
)
}
@@ -147,7 +147,7 @@ class KotlinDeserializedJvmSymbolsProvider(
return this?.let {
FirResolvedTypeRefImpl(
session, null, it.constructType(emptyList(), isNullable = false),
isMarkedNullable = false, annotations = emptyList()
annotations = emptyList()
)
} ?: FirErrorTypeRefImpl(session, null, "Symbol not found for $classId")
@@ -302,7 +302,6 @@ class KotlinDeserializedJvmSymbolsProvider(
session,
null,
ConeClassTypeImpl(ConeClassLikeLookupTagImpl(outerClassId), emptyArray(), false),
false,
emptyList()
)
}
@@ -84,12 +84,12 @@ private fun JavaType?.enhancePossiblyFlexible(
FirResolvedTypeRefImpl(
session, psi = null,
type = coneFlexibleOrSimpleType(session, lowerResult, upperResult),
isMarkedNullable = false, annotations = annotations
annotations = annotations
)
}
else -> {
val enhanced = type.toNotNullConeKotlinType(session, javaTypeParameterStack)
FirResolvedTypeRefImpl(session, psi = null, type = enhanced, isMarkedNullable = false, annotations = annotations)
FirResolvedTypeRefImpl(session, psi = null, type = enhanced, annotations = annotations)
}
}
}