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 ConeIntersectionType,
|
||||
is ConeIntegerLiteralType -> {
|
||||
is ConeIntersectionType -> {
|
||||
val approximatedType = if (toSuper) {
|
||||
typeApproximator.approximateToSuperType(type, TypeApproximatorConfiguration.PublicDeclaration)
|
||||
} else {
|
||||
@@ -604,6 +603,9 @@ class FirElementSerializer private constructor(
|
||||
}
|
||||
return typeProto(approximatedType as ConeKotlinType)
|
||||
}
|
||||
is ConeIntegerLiteralType -> {
|
||||
throw IllegalStateException("Integer literal types should not persist up to the serializer: ${type.render()}")
|
||||
}
|
||||
is ConeCapturedType -> {
|
||||
throw IllegalStateException("Captured types should not persist up to the serializer: ${type.render()}")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user