Kotlin: Add support for enum value accesses

This commit is contained in:
Ian Lynagh
2021-11-01 17:43:38 +00:00
parent d565a16fe6
commit 6c957284de
2 changed files with 13 additions and 0 deletions

View File

@@ -1520,6 +1520,17 @@ class X {
tw.writeVariableBinding(id, vId)
}
}
is IrGetEnumValue -> {
val exprParent = parent.expr(e, callable)
val id = tw.getFreshIdLabel<DbVaraccess>()
val type = useType(e.type)
val locId = tw.getLocation(e)
tw.writeExprs_varaccess(id, type.javaResult.id, type.kotlinResult.id, exprParent.parent, exprParent.idx)
tw.writeHasLocation(id, locId)
val owner = e.symbol.owner
val vId = useEnumEntry(owner)
tw.writeVariableBinding(id, vId)
}
is IrSetValue -> {
val exprParent = parent.expr(e, callable)
val id = tw.getFreshIdLabel<DbAssignexpr>()