mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Kotlin: Add support for IMPLICIT_COERCION_TO_UNIT
This commit is contained in:
@@ -1517,6 +1517,16 @@ class X {
|
||||
extractTypeAccess(e.typeOperand, id, 0, e)
|
||||
extractExpressionExpr(e.argument, callable, id, 1)
|
||||
}
|
||||
IrTypeOperator.IMPLICIT_COERCION_TO_UNIT -> {
|
||||
// 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)
|
||||
|
||||
@@ -74,6 +74,8 @@
|
||||
| exprs.kt:50:12:50:19 | variable | VarAccess |
|
||||
| exprs.kt:50:12:50:23 | ... > ... | GTExpr |
|
||||
| exprs.kt:50:23:50:23 | 0 | IntegerLiteral |
|
||||
| exprs.kt:51:9:51:18 | (...)... | CastExpr |
|
||||
| exprs.kt:51:9:51:18 | void | TypeAccess |
|
||||
| exprs.kt:54:12:54:14 | 123 | IntegerLiteral |
|
||||
| exprs.kt:54:12:54:20 | ... + ... | AddExpr |
|
||||
| exprs.kt:54:18:54:20 | 456 | IntegerLiteral |
|
||||
|
||||
Reference in New Issue
Block a user