mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
Kotlin 2: Accept a test change
With:
open class Root {}
class Subclass1: Root() {}
fun typeTests(x: Root, y: Subclass1) {
val y1: Subclass1 = if (x is Subclass1) { x } else { y }
}
we now get a slightly different AST, which means we no longer need to
insert a StmtExpr:
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=<root>.Subclass1
GET_VAR 'x: <root>.Root declared in <root>.typeTests' type=<root>.Root origin=null
- then: TYPE_OP type=<root>.Subclass1 origin=IMPLICIT_CAST typeOperand=<root>.Subclass1
- BLOCK type=<root>.Root origin=null
+ then: BLOCK type=<root>.Subclass1 origin=null
+ TYPE_OP type=<root>.Subclass1 origin=IMPLICIT_CAST typeOperand=<root>.Subclass1
GET_VAR 'x: <root>.Root declared in <root>.typeTests' type=<root>.Root origin=null
This commit is contained in:
@@ -1423,7 +1423,6 @@
|
||||
| exprs.kt:160:29:160:29 | x | exprs.kt:156:1:163:1 | typeTests | VarAccess |
|
||||
| exprs.kt:160:29:160:42 | ...instanceof... | exprs.kt:156:1:163:1 | typeTests | InstanceOfExpr |
|
||||
| exprs.kt:160:29:160:42 | Subclass1 | exprs.kt:156:1:163:1 | typeTests | TypeAccess |
|
||||
| exprs.kt:160:45:160:49 | <Stmt> | exprs.kt:156:1:163:1 | typeTests | StmtExpr |
|
||||
| exprs.kt:160:47:160:47 | <implicit cast> | exprs.kt:156:1:163:1 | typeTests | ImplicitCastExpr |
|
||||
| exprs.kt:160:47:160:47 | Subclass1 | exprs.kt:156:1:163:1 | typeTests | TypeAccess |
|
||||
| exprs.kt:160:47:160:47 | x | exprs.kt:156:1:163:1 | typeTests | VarAccess |
|
||||
|
||||
Reference in New Issue
Block a user