diff --git a/compiler/fir/fir-serialization/src/org/jetbrains/kotlin/fir/serialization/FirElementSerializer.kt b/compiler/fir/fir-serialization/src/org/jetbrains/kotlin/fir/serialization/FirElementSerializer.kt index d6d8d0cc3e2..4358e9ca1b8 100644 --- a/compiler/fir/fir-serialization/src/org/jetbrains/kotlin/fir/serialization/FirElementSerializer.kt +++ b/compiler/fir/fir-serialization/src/org/jetbrains/kotlin/fir/serialization/FirElementSerializer.kt @@ -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()}") }