[IR] KotlinLikeDumper: unify representation for error nodes

This commit is contained in:
Zalim Bashorov
2020-11-23 20:38:32 +03:00
committed by teamcityserver
parent f8690d0395
commit ef9a901635
@@ -389,7 +389,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption
is IrDynamicType -> is IrDynamicType ->
p.printWithNoIndent("dynamic") p.printWithNoIndent("dynamic")
is IrErrorType -> is IrErrorType ->
p.printWithNoIndent("ErrorType /* ERROR */") p.printWithNoIndent("ErrorType")
else -> else ->
p.printWithNoIndent("??? /* ERROR: unknown type: ${this.javaClass.simpleName} */") p.printWithNoIndent("??? /* ERROR: unknown type: ${this.javaClass.simpleName} */")
} }
@@ -1339,18 +1339,18 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption
override fun visitErrorDeclaration(declaration: IrErrorDeclaration, data: IrDeclaration?) { override fun visitErrorDeclaration(declaration: IrErrorDeclaration, data: IrDeclaration?) {
// TODO declaration.printlnAnnotations() // TODO declaration.printlnAnnotations()
p.println("/* ERROR DECLARATION */") p.println("/* ErrorDeclaration */")
} }
override fun visitErrorExpression(expression: IrErrorExpression, data: IrDeclaration?) { override fun visitErrorExpression(expression: IrErrorExpression, data: IrDeclaration?) {
// TODO description // TODO description
p.printWithNoIndent("error(\"\") /* ERROR EXPRESSION */") p.printWithNoIndent("error(\"\") /* ErrorExpression */")
} }
override fun visitErrorCallExpression(expression: IrErrorCallExpression, data: IrDeclaration?) { override fun visitErrorCallExpression(expression: IrErrorCallExpression, data: IrDeclaration?) {
// TODO description // TODO description
// TODO better rendering // TODO better rendering
p.printWithNoIndent("error(\"\") /* ERROR CALL */") p.printWithNoIndent("error(\"\") /* ErrorCallExpression */")
expression.explicitReceiver?.let { expression.explicitReceiver?.let {
it.accept(this, data) it.accept(this, data)
p.printWithNoIndent("; ") p.printWithNoIndent("; ")