FIR serializer: throw exception on getting ConeIntegerLiteralType
This commit assumes that ILTs are forbidden at the end of resolve, at least in public API
This commit is contained in:
+4
-2
@@ -592,8 +592,7 @@ class FirElementSerializer private constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
is ConeDefinitelyNotNullType,
|
is ConeDefinitelyNotNullType,
|
||||||
is ConeIntersectionType,
|
is ConeIntersectionType -> {
|
||||||
is ConeIntegerLiteralType -> {
|
|
||||||
val approximatedType = if (toSuper) {
|
val approximatedType = if (toSuper) {
|
||||||
typeApproximator.approximateToSuperType(type, TypeApproximatorConfiguration.PublicDeclaration)
|
typeApproximator.approximateToSuperType(type, TypeApproximatorConfiguration.PublicDeclaration)
|
||||||
} else {
|
} else {
|
||||||
@@ -604,6 +603,9 @@ class FirElementSerializer private constructor(
|
|||||||
}
|
}
|
||||||
return typeProto(approximatedType as ConeKotlinType)
|
return typeProto(approximatedType as ConeKotlinType)
|
||||||
}
|
}
|
||||||
|
is ConeIntegerLiteralType -> {
|
||||||
|
throw IllegalStateException("Integer literal types should not persist up to the serializer: ${type.render()}")
|
||||||
|
}
|
||||||
is ConeCapturedType -> {
|
is ConeCapturedType -> {
|
||||||
throw IllegalStateException("Captured types should not persist up to the serializer: ${type.render()}")
|
throw IllegalStateException("Captured types should not persist up to the serializer: ${type.render()}")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user