[IR] Support IrErrorType & IrErrorDeclaration in ir mangler
This commit is contained in:
+2
@@ -19,6 +19,8 @@ enum class MangleConstant(val prefix: Char, val separator: Char, val suffix: Cha
|
||||
const val EXPECT_MARK = "#expect"
|
||||
const val UNKNOWN_MARK = "<unknown>"
|
||||
const val DYNAMIC_MARK = "<dynamic>"
|
||||
const val ERROR_MARK = "<ERROR CLASS>"
|
||||
const val ERROR_DECLARATION = "<ERROR DECLARATION>"
|
||||
const val STATIC_MEMBER_MARK = "#static"
|
||||
|
||||
const val VARIANCE_SEPARATOR = '|'
|
||||
|
||||
+1
@@ -45,6 +45,7 @@ abstract class IrExportCheckerVisitor : IrElementVisitor<Boolean, Nothing?>, Kot
|
||||
override fun visitValueParameter(declaration: IrValueParameter, data: Nothing?) = false
|
||||
override fun visitVariable(declaration: IrVariable, data: Nothing?) = false
|
||||
override fun visitLocalDelegatedProperty(declaration: IrLocalDelegatedProperty, data: Nothing?) = false
|
||||
override fun visitErrorDeclaration(declaration: IrErrorDeclaration, data: Nothing?): Boolean = false
|
||||
|
||||
override fun visitTypeParameter(declaration: IrTypeParameter, data: Nothing?) = false
|
||||
|
||||
|
||||
+5
@@ -177,6 +177,7 @@ abstract class IrMangleComputer(protected val builder: StringBuilder, private va
|
||||
if (type.hasQuestionMark) tBuilder.appendSignature(MangleConstant.Q_MARK)
|
||||
}
|
||||
is IrDynamicType -> tBuilder.appendSignature(MangleConstant.DYNAMIC_MARK)
|
||||
is IrErrorType -> tBuilder.appendSignature(MangleConstant.ERROR_MARK)
|
||||
else -> error("Unexpected type $type")
|
||||
}
|
||||
}
|
||||
@@ -187,6 +188,10 @@ abstract class IrMangleComputer(protected val builder: StringBuilder, private va
|
||||
declaration.parent.accept(this, data)
|
||||
}
|
||||
|
||||
override fun visitErrorDeclaration(declaration: IrErrorDeclaration, data: Boolean) {
|
||||
declaration.mangleSimpleDeclaration(MangleConstant.ERROR_DECLARATION)
|
||||
}
|
||||
|
||||
override fun visitClass(declaration: IrClass, data: Boolean) {
|
||||
isRealExpect = isRealExpect or declaration.isExpect
|
||||
typeParameterContainer.add(declaration)
|
||||
|
||||
Reference in New Issue
Block a user