@@ -1466,12 +1466,35 @@ class X {
14661466 tw.writeHasLocation(id, locId)
14671467 extractExpressionExpr(e.argument, callable, id, 0 )
14681468 }
1469+ is IrTypeOperatorCall -> {
1470+ extractTypeOperatorCall(e, callable, parent, idx)
1471+ }
14691472 else -> {
14701473 logger.warnElement(Severity .ErrorSevere , " Unrecognised IrExpression: " + e.javaClass, e)
14711474 }
14721475 }
14731476 }
14741477
1478+ fun extractTypeOperatorCall (e : IrTypeOperatorCall , callable : Label <out DbCallable >, parent : Label <out DbExprparent >, idx : Int ) {
1479+ when (e.operator ) {
1480+ IrTypeOperator .INSTANCEOF -> {
1481+ val id = tw.getFreshIdLabel<DbInstanceofexpr >()
1482+ val locId = tw.getLocation(e)
1483+ val type = useType(e.type)
1484+ tw.writeExprs_instanceofexpr(id, type.javaResult.id, type.kotlinResult.id, parent, idx)
1485+ tw.writeHasLocation(id, locId)
1486+ extractExpressionExpr(e.argument, callable, id, 0 )
1487+ val typeArg = useType(e.typeOperand)
1488+ val typeAccessId = tw.getFreshIdLabel<DbUnannotatedtypeaccess >()
1489+ tw.writeExprs_unannotatedtypeaccess(typeAccessId, typeArg.javaResult.id, typeArg.kotlinResult.id, id, 1 )
1490+ // TODO: Type access location
1491+ }
1492+ else -> {
1493+ logger.warnElement(Severity .ErrorSevere , " Unrecognised IrTypeOperatorCall: " + e.render(), e)
1494+ }
1495+ }
1496+ }
1497+
14751498 private fun extractBreakContinue (
14761499 e : IrBreakContinue ,
14771500 id : Label <out DbBreakcontinuestmt >
@@ -1491,4 +1514,4 @@ class X {
14911514
14921515 tw.writeKtBreakContinueTargets(id, loopId)
14931516 }
1494- }
1517+ }
0 commit comments