[IR] KotlinLikeDumper: super and receiver on field accesses
This commit is contained in:
committed by
teamcityserver
parent
0bf587ad4b
commit
029ee6f2e7
@@ -978,18 +978,31 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun visitGetField(expression: IrGetField, data: IrDeclaration?) {
|
override fun visitGetField(expression: IrGetField, data: IrDeclaration?) {
|
||||||
expression.printFieldAccess()
|
expression.printFieldAccess(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun visitSetField(expression: IrSetField, data: IrDeclaration?) {
|
override fun visitSetField(expression: IrSetField, data: IrDeclaration?) {
|
||||||
expression.printFieldAccess()
|
expression.printFieldAccess(data)
|
||||||
p.printWithNoIndent(" = ")
|
p.printWithNoIndent(" = ")
|
||||||
expression.value.accept(this, data)
|
expression.value.accept(this, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun IrFieldAccessExpression.printFieldAccess() {
|
private fun IrFieldAccessExpression.printFieldAccess(data: IrDeclaration?) {
|
||||||
// TODO receiver, superQualifierSymbol?
|
// TODO type
|
||||||
// TODO is not valid kotlin
|
// TODO is not valid kotlin
|
||||||
|
receiver?.accept(this@KotlinLikeDumper, data)
|
||||||
|
superQualifierSymbol?.let {
|
||||||
|
// TODO should we print super classifier somehow?
|
||||||
|
// TODO which supper? smart mode?
|
||||||
|
// TODO super and receiver at the same time:
|
||||||
|
// compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.kt
|
||||||
|
p.printWithNoIndent("super")
|
||||||
|
}
|
||||||
|
|
||||||
|
if (receiver != null || superQualifierSymbol != null) {
|
||||||
|
p.printWithNoIndent(".")
|
||||||
|
}
|
||||||
|
|
||||||
p.printWithNoIndent("#" + symbol.owner.name.asString())
|
p.printWithNoIndent("#" + symbol.owner.name.asString())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user