FIR serializer: consider exotic types as errors (breaks 4 BB tests)
This commit is contained in:
+2
-20
@@ -550,10 +550,6 @@ class FirElementSerializer private constructor(
|
|||||||
val builder = ProtoBuf.Type.newBuilder()
|
val builder = ProtoBuf.Type.newBuilder()
|
||||||
|
|
||||||
when (type) {
|
when (type) {
|
||||||
is ConeIntegerLiteralType -> {
|
|
||||||
// Questionable, I'm not sure we should expect this type here
|
|
||||||
return typeProto(type.getApproximatedType())
|
|
||||||
}
|
|
||||||
is ConeKotlinErrorType -> {
|
is ConeKotlinErrorType -> {
|
||||||
extension.serializeErrorType(type, builder)
|
extension.serializeErrorType(type, builder)
|
||||||
return builder
|
return builder
|
||||||
@@ -569,20 +565,6 @@ class FirElementSerializer private constructor(
|
|||||||
}
|
}
|
||||||
return lowerBound
|
return lowerBound
|
||||||
}
|
}
|
||||||
is ConeCapturedType -> {
|
|
||||||
val lowerType = type.lowerType
|
|
||||||
return if (lowerType != null) {
|
|
||||||
typeProto(lowerType)
|
|
||||||
} else {
|
|
||||||
typeProto(type.constructor.supertypes!!.first())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
is ConeDefinitelyNotNullType -> {
|
|
||||||
return typeProto(type.original)
|
|
||||||
}
|
|
||||||
is ConeIntersectionType -> {
|
|
||||||
return typeProto(type.intersectedTypes.first())
|
|
||||||
}
|
|
||||||
is ConeClassLikeType -> {
|
is ConeClassLikeType -> {
|
||||||
if (type.isSuspendFunctionType(session)) {
|
if (type.isSuspendFunctionType(session)) {
|
||||||
val runtimeFunctionType = transformSuspendFunctionToRuntimeFunctionType(type)
|
val runtimeFunctionType = transformSuspendFunctionToRuntimeFunctionType(type)
|
||||||
@@ -600,8 +582,8 @@ class FirElementSerializer private constructor(
|
|||||||
builder.typeParameter = getTypeParameterId(typeParameter)
|
builder.typeParameter = getTypeParameterId(typeParameter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
is ConeLookupTagBasedType, is ConeStubType -> {
|
else -> {
|
||||||
throw AssertionError("Should not be here")
|
throw AssertionError("Should not be here: ${type::class.java}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// IGNORE_BACKEND_FIR: JVM_IR
|
||||||
// !DIAGNOSTICS: -DEBUG_INFO_SMARTCAST
|
// !DIAGNOSTICS: -DEBUG_INFO_SMARTCAST
|
||||||
|
|
||||||
fun <R> foo(f: () -> R): R = f()
|
fun <R> foo(f: () -> R): R = f()
|
||||||
|
|||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// IGNORE_BACKEND_FIR: JVM_IR
|
||||||
// !LANGUAGE: +StrictJavaNullabilityAssertions
|
// !LANGUAGE: +StrictJavaNullabilityAssertions
|
||||||
// TARGET_BACKEND: JVM
|
// TARGET_BACKEND: JVM
|
||||||
// SKIP_JDK6
|
// SKIP_JDK6
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// IGNORE_BACKEND_FIR: JVM_IR
|
||||||
class A (val p: String, p1: String, p2: String) {
|
class A (val p: String, p1: String, p2: String) {
|
||||||
|
|
||||||
var cond1 :String = ""
|
var cond1 :String = ""
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// IGNORE_BACKEND_FIR: JVM_IR
|
||||||
interface In<in E>
|
interface In<in E>
|
||||||
class A : In<A>
|
class A : In<A>
|
||||||
class B : In<B>
|
class B : In<B>
|
||||||
|
|||||||
Reference in New Issue
Block a user