ConeFlexibleType: statically require to have simple bounds
This commit is contained in:
@@ -58,8 +58,8 @@ class FirSamResolverImpl(
|
||||
return when (type) {
|
||||
is ConeClassLikeType -> getFunctionTypeForPossibleSamType(type.fullyExpandedType(session))
|
||||
is ConeFlexibleType -> ConeFlexibleType(
|
||||
getFunctionTypeForPossibleSamType(type.lowerBound) ?: return null,
|
||||
getFunctionTypeForPossibleSamType(type.upperBound) ?: return null,
|
||||
getFunctionTypeForPossibleSamType(type.lowerBound)?.lowerBoundIfFlexible() ?: return null,
|
||||
getFunctionTypeForPossibleSamType(type.upperBound)?.upperBoundIfFlexible() ?: return null,
|
||||
)
|
||||
is ConeClassErrorType, is ConeStubType -> null
|
||||
// TODO: support those types as well
|
||||
|
||||
+1
-1
@@ -92,7 +92,7 @@ internal object CreateFreshTypeVariableSubstitutorStage : ResolutionStage() {
|
||||
session: FirSession,
|
||||
): ConeKotlinType {
|
||||
return if (typeParameter.shouldBeFlexible(session.typeContext)) {
|
||||
val notNullType = type.withNullability(ConeNullability.NOT_NULL, session.typeContext)
|
||||
val notNullType = type.withNullability(ConeNullability.NOT_NULL, session.typeContext) as ConeSimpleKotlinType
|
||||
ConeFlexibleType(notNullType, notNullType.withNullability(ConeNullability.NULLABLE, session.typeContext))
|
||||
} else {
|
||||
type
|
||||
|
||||
Reference in New Issue
Block a user