Kotlin: Add support for IMPLICIT_NOTNULL

This commit is contained in:
Ian Lynagh
2021-10-28 17:07:02 +01:00
parent d181b4b9cc
commit 46e55f5990
2 changed files with 13 additions and 0 deletions

View File

@@ -1507,6 +1507,16 @@ class X {
extractTypeAccess(e.typeOperand, id, 0, e)
extractExpressionExpr(e.argument, callable, id, 1)
}
IrTypeOperator.IMPLICIT_NOTNULL -> {
// TODO: Make this distinguishable from an explicit cast?
val id = tw.getFreshIdLabel<DbCastexpr>()
val locId = tw.getLocation(e)
val type = useType(e.type)
tw.writeExprs_castexpr(id, type.javaResult.id, type.kotlinResult.id, parent, idx)
tw.writeHasLocation(id, locId)
extractTypeAccess(e.typeOperand, id, 0, e)
extractExpressionExpr(e.argument, callable, id, 1)
}
IrTypeOperator.INSTANCEOF -> {
val id = tw.getFreshIdLabel<DbInstanceofexpr>()
val locId = tw.getLocation(e)