Skip to content

Commit 24c4c3e

Browse files
committed
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
1 parent 3d8ac14 commit 24c4c3e

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

java/ql/test-kotlin2/library-tests/exprs/exprs.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1423,7 +1423,6 @@
14231423
| exprs.kt:160:29:160:29 | x | exprs.kt:156:1:163:1 | typeTests | VarAccess |
14241424
| exprs.kt:160:29:160:42 | ...instanceof... | exprs.kt:156:1:163:1 | typeTests | InstanceOfExpr |
14251425
| exprs.kt:160:29:160:42 | Subclass1 | exprs.kt:156:1:163:1 | typeTests | TypeAccess |
1426-
| exprs.kt:160:45:160:49 | <Stmt> | exprs.kt:156:1:163:1 | typeTests | StmtExpr |
14271426
| exprs.kt:160:47:160:47 | <implicit cast> | exprs.kt:156:1:163:1 | typeTests | ImplicitCastExpr |
14281427
| exprs.kt:160:47:160:47 | Subclass1 | exprs.kt:156:1:163:1 | typeTests | TypeAccess |
14291428
| exprs.kt:160:47:160:47 | x | exprs.kt:156:1:163:1 | typeTests | VarAccess |

0 commit comments

Comments
 (0)