FIR serializer: special handling of Continuation
This commit is contained in:
committed by
Mikhail Glukhikh
parent
5d2adce7ab
commit
b4ac2f5b55
+13
-4
@@ -649,10 +649,19 @@ class FirElementSerializer private constructor(
|
||||
}
|
||||
|
||||
private fun fillFromPossiblyInnerType(builder: ProtoBuf.Type.Builder, type: ConeClassLikeType) {
|
||||
val classifierSymbol = type.lookupTag.toSymbol(session) ?: error("Can't lookup $type")
|
||||
val classifier = classifierSymbol.fir
|
||||
val classifierId = getClassifierId(classifier)
|
||||
builder.className = classifierId
|
||||
val classifierSymbol = type.lookupTag.toSymbol(session)
|
||||
when {
|
||||
classifierSymbol != null -> {
|
||||
val classifier = classifierSymbol.fir
|
||||
val classifierId = getClassifierId(classifier)
|
||||
builder.className = classifierId
|
||||
}
|
||||
// Special case: `Continuation` can be added via [transformSuspendFunctionToRuntimeFunctionType]
|
||||
type.lookupTag.classId == CONTINUATION_INTERFACE_CLASS_ID -> {
|
||||
builder.className = stringTable.getQualifiedClassNameIndex(type.lookupTag.classId.asString(), isLocal = false)
|
||||
}
|
||||
else -> error("Can't lookup $type")
|
||||
}
|
||||
|
||||
for (projection in type.typeArguments) {
|
||||
builder.addArgument(typeArgument(projection))
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// !LANGUAGE: +SuspendConversion
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// FILE: suspendCovnersion.kt
|
||||
|
||||
fun checkNotEqual(x: Any, y: Any) {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
|
||||
// KT-37163
|
||||
|
||||
Reference in New Issue
Block a user