Skip to content

Commit 4f8ea3d

Browse files
kotlin-extractor: fix K1 local variable locations to span from val/var to initializer
In K1 mode, IrVariable.startOffset points to the name identifier and IrVariable.endOffset is also at the name end, giving a location that covers only the variable name (e.g. "local1") rather than the full declaration ("val local1 = 2 + 3"). In K2 mode the IR offsets already point from the val/var keyword to the end of the initializer, matching the intuitive source span. Fix this for K1 by adding an IrVariable-specific overload of getPsiBasedLocation that: 1. finds the leaf PSI element at v.startOffset (the name identifier) 2. walks up to the enclosing KtVariableDeclaration (KtProperty) 3. uses the val/var keyword position as the start offset to exclude any leading annotations from the span This matches the K2 IR behavior and gives a more complete location for variable declarations when used in CodeQL queries. The fix applies to both K1 and K2 since the overload is unconditional; for K2 the walk-up gives the same result as before. Expected updates in test-kotlin1: - variables: local variable locations now span from val/var to initializer - exprs, stmts, methods, modifiers, reflection: same local variable span - controlflow/basic: CFG node references updated for new variable spans (the "var ...;" node now starts at the val/var keyword) Class member and top-level properties (IrProperty, not IrVariable) are not affected by this change and retain their existing location behaviour. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent d00c5f4 commit 4f8ea3d

15 files changed

Lines changed: 529 additions & 497 deletions

File tree

java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ import org.jetbrains.kotlin.load.java.structure.impl.classFiles.BinaryJavaClass
5353
import org.jetbrains.kotlin.name.FqName
5454
import org.jetbrains.kotlin.types.Variance
5555
import org.jetbrains.kotlin.util.OperatorNameConventions
56+
import org.jetbrains.kotlin.psi.KtProperty
57+
import org.jetbrains.kotlin.psi.KtVariableDeclaration
5658
import org.jetbrains.kotlin.psi.psiUtil.endOffset
5759
import org.jetbrains.kotlin.psi.psiUtil.startOffset
5860
import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstanceOrNull
@@ -2899,6 +2901,36 @@ open class KotlinFileExtractor(
28992901
private fun getPsiBasedLocation(decl: IrDeclaration): Label<DbLocation>? =
29002902
getPsiBasedLocation(decl as IrElement)
29012903

2904+
/**
2905+
* Returns the PSI-based location for a local variable declaration.
2906+
*
2907+
* In K2 mode, [IrVariable.startOffset] points to the `val`/`var` keyword
2908+
* and [IrVariable.endOffset] points past the initialiser, giving the full
2909+
* declaration span without annotations. In K1 mode the IR records only the
2910+
* name identifier's range.
2911+
*
2912+
* To produce the same span in K1 we look up the leaf PSI element at
2913+
* [IrVariable.startOffset] (the name), walk up to the enclosing
2914+
* [KtVariableDeclaration], and then use the `val`/`var` keyword position as
2915+
* the start rather than the declaration's raw textRange start (which would
2916+
* include any leading annotations).
2917+
*/
2918+
private fun getPsiBasedLocation(v: IrVariable): Label<DbLocation>? {
2919+
val startOffset = v.startOffset
2920+
if (startOffset < 0) return null
2921+
val file = currentIrFile ?: return null
2922+
val ktFile = getPsi2Ir()?.getKtFile(file) ?: return null
2923+
val nameElement = ktFile.findElementAt(startOffset) ?: return null
2924+
val declaration = generateSequence(nameElement) { it.parent }
2925+
.filterIsInstance<KtVariableDeclaration>()
2926+
.firstOrNull() ?: return null
2927+
// Use the val/var keyword as the start to avoid including leading annotations
2928+
// in the location (KtProperty.textRange starts before annotations).
2929+
val declStart = (declaration as? KtProperty)?.valOrVarKeyword?.startOffset
2930+
?: declaration.startOffset
2931+
return tw.getLocation(declStart, declaration.endOffset)
2932+
}
2933+
29022934
private fun extractVariable(
29032935
v: IrVariable,
29042936
callable: Label<out DbCallable>,

java/ql/test-kotlin1/library-tests/controlflow/basic/bbStmts.expected

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,30 @@
99
| Test.kt:3:8:80:1 | Entry | 8 | Test.kt:3:8:80:1 | Exit |
1010
| Test.kt:4:2:79:2 | Entry | 0 | Test.kt:4:2:79:2 | Entry |
1111
| Test.kt:4:2:79:2 | Entry | 1 | Test.kt:4:13:79:2 | { ... } |
12-
| Test.kt:4:2:79:2 | Entry | 2 | Test.kt:5:7:5:7 | var ...; |
13-
| Test.kt:4:2:79:2 | Entry | 3 | Test.kt:5:7:5:7 | Before x |
12+
| Test.kt:4:2:79:2 | Entry | 2 | Test.kt:5:3:5:16 | var ...; |
13+
| Test.kt:4:2:79:2 | Entry | 3 | Test.kt:5:3:5:16 | Before x |
1414
| Test.kt:4:2:79:2 | Entry | 4 | Test.kt:5:16:5:16 | 0 |
15-
| Test.kt:4:2:79:2 | Entry | 5 | Test.kt:5:7:5:7 | x |
16-
| Test.kt:4:2:79:2 | Entry | 6 | Test.kt:5:7:5:7 | After x |
17-
| Test.kt:4:2:79:2 | Entry | 7 | Test.kt:5:7:5:7 | After var ...; |
18-
| Test.kt:4:2:79:2 | Entry | 8 | Test.kt:6:7:6:7 | var ...; |
19-
| Test.kt:4:2:79:2 | Entry | 9 | Test.kt:6:7:6:7 | Before y |
15+
| Test.kt:4:2:79:2 | Entry | 5 | Test.kt:5:3:5:16 | x |
16+
| Test.kt:4:2:79:2 | Entry | 6 | Test.kt:5:3:5:16 | After x |
17+
| Test.kt:4:2:79:2 | Entry | 7 | Test.kt:5:3:5:16 | After var ...; |
18+
| Test.kt:4:2:79:2 | Entry | 8 | Test.kt:6:3:6:18 | var ...; |
19+
| Test.kt:4:2:79:2 | Entry | 9 | Test.kt:6:3:6:18 | Before y |
2020
| Test.kt:4:2:79:2 | Entry | 10 | Test.kt:6:17:6:18 | 50 |
21-
| Test.kt:4:2:79:2 | Entry | 11 | Test.kt:6:7:6:7 | y |
22-
| Test.kt:4:2:79:2 | Entry | 12 | Test.kt:6:7:6:7 | After y |
23-
| Test.kt:4:2:79:2 | Entry | 13 | Test.kt:6:7:6:7 | After var ...; |
24-
| Test.kt:4:2:79:2 | Entry | 14 | Test.kt:7:7:7:7 | var ...; |
25-
| Test.kt:4:2:79:2 | Entry | 15 | Test.kt:7:7:7:7 | Before z |
21+
| Test.kt:4:2:79:2 | Entry | 11 | Test.kt:6:3:6:18 | y |
22+
| Test.kt:4:2:79:2 | Entry | 12 | Test.kt:6:3:6:18 | After y |
23+
| Test.kt:4:2:79:2 | Entry | 13 | Test.kt:6:3:6:18 | After var ...; |
24+
| Test.kt:4:2:79:2 | Entry | 14 | Test.kt:7:3:7:16 | var ...; |
25+
| Test.kt:4:2:79:2 | Entry | 15 | Test.kt:7:3:7:16 | Before z |
2626
| Test.kt:4:2:79:2 | Entry | 16 | Test.kt:7:16:7:16 | 0 |
27-
| Test.kt:4:2:79:2 | Entry | 17 | Test.kt:7:7:7:7 | z |
28-
| Test.kt:4:2:79:2 | Entry | 18 | Test.kt:7:7:7:7 | After z |
29-
| Test.kt:4:2:79:2 | Entry | 19 | Test.kt:7:7:7:7 | After var ...; |
30-
| Test.kt:4:2:79:2 | Entry | 20 | Test.kt:8:7:8:7 | var ...; |
31-
| Test.kt:4:2:79:2 | Entry | 21 | Test.kt:8:7:8:7 | Before w |
27+
| Test.kt:4:2:79:2 | Entry | 17 | Test.kt:7:3:7:16 | z |
28+
| Test.kt:4:2:79:2 | Entry | 18 | Test.kt:7:3:7:16 | After z |
29+
| Test.kt:4:2:79:2 | Entry | 19 | Test.kt:7:3:7:16 | After var ...; |
30+
| Test.kt:4:2:79:2 | Entry | 20 | Test.kt:8:3:8:16 | var ...; |
31+
| Test.kt:4:2:79:2 | Entry | 21 | Test.kt:8:3:8:16 | Before w |
3232
| Test.kt:4:2:79:2 | Entry | 22 | Test.kt:8:16:8:16 | 0 |
33-
| Test.kt:4:2:79:2 | Entry | 23 | Test.kt:8:7:8:7 | w |
34-
| Test.kt:4:2:79:2 | Entry | 24 | Test.kt:8:7:8:7 | After w |
35-
| Test.kt:4:2:79:2 | Entry | 25 | Test.kt:8:7:8:7 | After var ...; |
33+
| Test.kt:4:2:79:2 | Entry | 23 | Test.kt:8:3:8:16 | w |
34+
| Test.kt:4:2:79:2 | Entry | 24 | Test.kt:8:3:8:16 | After w |
35+
| Test.kt:4:2:79:2 | Entry | 25 | Test.kt:8:3:8:16 | After var ...; |
3636
| Test.kt:4:2:79:2 | Entry | 26 | Test.kt:11:3:16:3 | <Expr>; |
3737
| Test.kt:4:2:79:2 | Entry | 27 | Test.kt:11:3:16:3 | when ... |
3838
| Test.kt:4:2:79:2 | Entry | 28 | Test.kt:11:3:16:3 | ... -> ... |
@@ -221,17 +221,17 @@
221221
| Test.kt:82:1:89:1 | Entry | 1 | Test.kt:82:21:89:1 | { ... } |
222222
| Test.kt:82:1:89:1 | Entry | 2 | Test.kt:83:2:88:2 | try ... |
223223
| Test.kt:82:1:89:1 | Entry | 3 | Test.kt:83:6:86:2 | { ... } |
224-
| Test.kt:82:1:89:1 | Entry | 4 | Test.kt:84:7:84:7 | var ...; |
225-
| Test.kt:82:1:89:1 | Entry | 5 | Test.kt:84:7:84:7 | Before x |
224+
| Test.kt:82:1:89:1 | Entry | 4 | Test.kt:84:3:84:18 | var ...; |
225+
| Test.kt:82:1:89:1 | Entry | 5 | Test.kt:84:3:84:18 | Before x |
226226
| Test.kt:82:1:89:1 | Entry | 6 | Test.kt:84:11:84:18 | Before (...)... |
227227
| Test.kt:82:1:89:1 | Entry | 7 | Test.kt:84:11:84:11 | o |
228228
| Test.kt:82:1:89:1 | Entry | 8 | Test.kt:84:11:84:18 | (...)... |
229229
| Test.kt:82:1:89:1 | Exit | 0 | Test.kt:82:1:89:1 | Exit |
230230
| Test.kt:82:1:89:1 | Normal Exit | 0 | Test.kt:82:1:89:1 | Normal Exit |
231231
| Test.kt:84:11:84:18 | After (...)... | 0 | Test.kt:84:11:84:18 | After (...)... |
232-
| Test.kt:84:11:84:18 | After (...)... | 1 | Test.kt:84:7:84:7 | x |
233-
| Test.kt:84:11:84:18 | After (...)... | 2 | Test.kt:84:7:84:7 | After x |
234-
| Test.kt:84:11:84:18 | After (...)... | 3 | Test.kt:84:7:84:7 | After var ...; |
232+
| Test.kt:84:11:84:18 | After (...)... | 1 | Test.kt:84:3:84:18 | x |
233+
| Test.kt:84:11:84:18 | After (...)... | 2 | Test.kt:84:3:84:18 | After x |
234+
| Test.kt:84:11:84:18 | After (...)... | 3 | Test.kt:84:3:84:18 | After var ...; |
235235
| Test.kt:84:11:84:18 | After (...)... | 4 | Test.kt:85:3:85:10 | Before return ... |
236236
| Test.kt:84:11:84:18 | After (...)... | 5 | Test.kt:85:10:85:10 | 1 |
237237
| Test.kt:84:11:84:18 | After (...)... | 6 | Test.kt:85:3:85:10 | return ... |
@@ -249,17 +249,17 @@
249249
| Test.kt:91:1:98:1 | Entry | 1 | Test.kt:91:22:98:1 | { ... } |
250250
| Test.kt:91:1:98:1 | Entry | 2 | Test.kt:92:2:97:2 | try ... |
251251
| Test.kt:91:1:98:1 | Entry | 3 | Test.kt:92:6:95:2 | { ... } |
252-
| Test.kt:91:1:98:1 | Entry | 4 | Test.kt:93:7:93:7 | var ...; |
253-
| Test.kt:91:1:98:1 | Entry | 5 | Test.kt:93:7:93:7 | Before x |
252+
| Test.kt:91:1:98:1 | Entry | 4 | Test.kt:93:3:93:13 | var ...; |
253+
| Test.kt:91:1:98:1 | Entry | 5 | Test.kt:93:3:93:13 | Before x |
254254
| Test.kt:91:1:98:1 | Entry | 6 | Test.kt:93:11:93:13 | Before ...!! |
255255
| Test.kt:91:1:98:1 | Entry | 7 | Test.kt:93:11:93:11 | o |
256256
| Test.kt:91:1:98:1 | Entry | 8 | Test.kt:93:11:93:13 | ...!! |
257257
| Test.kt:91:1:98:1 | Exit | 0 | Test.kt:91:1:98:1 | Exit |
258258
| Test.kt:91:1:98:1 | Normal Exit | 0 | Test.kt:91:1:98:1 | Normal Exit |
259259
| Test.kt:93:11:93:13 | After ...!! | 0 | Test.kt:93:11:93:13 | After ...!! |
260-
| Test.kt:93:11:93:13 | After ...!! | 1 | Test.kt:93:7:93:7 | x |
261-
| Test.kt:93:11:93:13 | After ...!! | 2 | Test.kt:93:7:93:7 | After x |
262-
| Test.kt:93:11:93:13 | After ...!! | 3 | Test.kt:93:7:93:7 | After var ...; |
260+
| Test.kt:93:11:93:13 | After ...!! | 1 | Test.kt:93:3:93:13 | x |
261+
| Test.kt:93:11:93:13 | After ...!! | 2 | Test.kt:93:3:93:13 | After x |
262+
| Test.kt:93:11:93:13 | After ...!! | 3 | Test.kt:93:3:93:13 | After var ...; |
263263
| Test.kt:93:11:93:13 | After ...!! | 4 | Test.kt:94:3:94:10 | Before return ... |
264264
| Test.kt:93:11:93:13 | After ...!! | 5 | Test.kt:94:10:94:10 | 1 |
265265
| Test.kt:93:11:93:13 | After ...!! | 6 | Test.kt:94:3:94:10 | return ... |

java/ql/test-kotlin1/library-tests/controlflow/basic/bbStrictDominance.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@
3030
| Test.kt:82:21:89:1 | { ... } | Test.kt:82:1:89:1 | Exceptional Exit |
3131
| Test.kt:82:21:89:1 | { ... } | Test.kt:82:1:89:1 | Exit |
3232
| Test.kt:82:21:89:1 | { ... } | Test.kt:82:1:89:1 | Normal Exit |
33-
| Test.kt:82:21:89:1 | { ... } | Test.kt:84:7:84:7 | x |
33+
| Test.kt:82:21:89:1 | { ... } | Test.kt:84:3:84:18 | x |
3434
| Test.kt:82:21:89:1 | { ... } | Test.kt:86:4:88:2 | catch (...) |
3535
| Test.kt:82:21:89:1 | { ... } | Test.kt:86:34:88:2 | { ... } |
3636
| Test.kt:86:4:88:2 | catch (...) | Test.kt:82:1:89:1 | Exceptional Exit |
3737
| Test.kt:86:4:88:2 | catch (...) | Test.kt:86:34:88:2 | { ... } |
3838
| Test.kt:91:22:98:1 | { ... } | Test.kt:91:1:98:1 | Exceptional Exit |
3939
| Test.kt:91:22:98:1 | { ... } | Test.kt:91:1:98:1 | Exit |
4040
| Test.kt:91:22:98:1 | { ... } | Test.kt:91:1:98:1 | Normal Exit |
41-
| Test.kt:91:22:98:1 | { ... } | Test.kt:93:7:93:7 | x |
41+
| Test.kt:91:22:98:1 | { ... } | Test.kt:93:3:93:13 | x |
4242
| Test.kt:91:22:98:1 | { ... } | Test.kt:95:4:97:2 | catch (...) |
4343
| Test.kt:91:22:98:1 | { ... } | Test.kt:95:36:97:2 | { ... } |
4444
| Test.kt:95:4:97:2 | catch (...) | Test.kt:91:1:98:1 | Exceptional Exit |

java/ql/test-kotlin1/library-tests/controlflow/basic/bbSuccessor.expected

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616
| Test.kt:43:3:43:3 | <Expr>; | Test.kt:4:2:79:2 | Normal Exit |
1717
| Test.kt:82:1:89:1 | Exceptional Exit | Test.kt:82:1:89:1 | Exit |
1818
| Test.kt:82:1:89:1 | Normal Exit | Test.kt:82:1:89:1 | Exit |
19-
| Test.kt:82:21:89:1 | { ... } | Test.kt:84:7:84:7 | x |
19+
| Test.kt:82:21:89:1 | { ... } | Test.kt:84:3:84:18 | x |
2020
| Test.kt:82:21:89:1 | { ... } | Test.kt:86:4:88:2 | catch (...) |
21-
| Test.kt:84:7:84:7 | x | Test.kt:82:1:89:1 | Normal Exit |
21+
| Test.kt:84:3:84:18 | x | Test.kt:82:1:89:1 | Normal Exit |
2222
| Test.kt:86:4:88:2 | catch (...) | Test.kt:82:1:89:1 | Exceptional Exit |
2323
| Test.kt:86:4:88:2 | catch (...) | Test.kt:86:34:88:2 | { ... } |
2424
| Test.kt:86:34:88:2 | { ... } | Test.kt:82:1:89:1 | Normal Exit |
2525
| Test.kt:91:1:98:1 | Exceptional Exit | Test.kt:91:1:98:1 | Exit |
2626
| Test.kt:91:1:98:1 | Normal Exit | Test.kt:91:1:98:1 | Exit |
27-
| Test.kt:91:22:98:1 | { ... } | Test.kt:93:7:93:7 | x |
27+
| Test.kt:91:22:98:1 | { ... } | Test.kt:93:3:93:13 | x |
2828
| Test.kt:91:22:98:1 | { ... } | Test.kt:95:4:97:2 | catch (...) |
29-
| Test.kt:93:7:93:7 | x | Test.kt:91:1:98:1 | Normal Exit |
29+
| Test.kt:93:3:93:13 | x | Test.kt:91:1:98:1 | Normal Exit |
3030
| Test.kt:95:4:97:2 | catch (...) | Test.kt:91:1:98:1 | Exceptional Exit |
3131
| Test.kt:95:4:97:2 | catch (...) | Test.kt:95:36:97:2 | { ... } |
3232
| Test.kt:95:36:97:2 | { ... } | Test.kt:91:1:98:1 | Normal Exit |

java/ql/test-kotlin1/library-tests/controlflow/basic/getASuccessor.expected

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66
| Test.kt:3:8:80:1 | { ... } | BlockStmt | Test.kt:3:8:80:1 | Normal Exit | Constructor |
77
| Test.kt:4:2:79:2 | Entry | Method | Test.kt:4:13:79:2 | { ... } | BlockStmt |
88
| Test.kt:4:2:79:2 | Normal Exit | Method | Test.kt:4:2:79:2 | Exit | Method |
9-
| Test.kt:4:13:79:2 | { ... } | BlockStmt | Test.kt:5:7:5:7 | var ...; | LocalVariableDeclStmt |
10-
| Test.kt:5:7:5:7 | var ...; | LocalVariableDeclStmt | Test.kt:5:16:5:16 | 0 | IntegerLiteral |
11-
| Test.kt:5:7:5:7 | x | LocalVariableDeclExpr | Test.kt:6:7:6:7 | var ...; | LocalVariableDeclStmt |
12-
| Test.kt:5:16:5:16 | 0 | IntegerLiteral | Test.kt:5:7:5:7 | x | LocalVariableDeclExpr |
13-
| Test.kt:6:7:6:7 | var ...; | LocalVariableDeclStmt | Test.kt:6:17:6:18 | 50 | LongLiteral |
14-
| Test.kt:6:7:6:7 | y | LocalVariableDeclExpr | Test.kt:7:7:7:7 | var ...; | LocalVariableDeclStmt |
15-
| Test.kt:6:17:6:18 | 50 | LongLiteral | Test.kt:6:7:6:7 | y | LocalVariableDeclExpr |
16-
| Test.kt:7:7:7:7 | var ...; | LocalVariableDeclStmt | Test.kt:7:16:7:16 | 0 | IntegerLiteral |
17-
| Test.kt:7:7:7:7 | z | LocalVariableDeclExpr | Test.kt:8:7:8:7 | var ...; | LocalVariableDeclStmt |
18-
| Test.kt:7:16:7:16 | 0 | IntegerLiteral | Test.kt:7:7:7:7 | z | LocalVariableDeclExpr |
19-
| Test.kt:8:7:8:7 | var ...; | LocalVariableDeclStmt | Test.kt:8:16:8:16 | 0 | IntegerLiteral |
20-
| Test.kt:8:7:8:7 | w | LocalVariableDeclExpr | Test.kt:11:3:16:3 | <Expr>; | ExprStmt |
21-
| Test.kt:8:16:8:16 | 0 | IntegerLiteral | Test.kt:8:7:8:7 | w | LocalVariableDeclExpr |
9+
| Test.kt:4:13:79:2 | { ... } | BlockStmt | Test.kt:5:3:5:16 | var ...; | LocalVariableDeclStmt |
10+
| Test.kt:5:3:5:16 | var ...; | LocalVariableDeclStmt | Test.kt:5:16:5:16 | 0 | IntegerLiteral |
11+
| Test.kt:5:3:5:16 | x | LocalVariableDeclExpr | Test.kt:6:3:6:18 | var ...; | LocalVariableDeclStmt |
12+
| Test.kt:5:16:5:16 | 0 | IntegerLiteral | Test.kt:5:3:5:16 | x | LocalVariableDeclExpr |
13+
| Test.kt:6:3:6:18 | var ...; | LocalVariableDeclStmt | Test.kt:6:17:6:18 | 50 | LongLiteral |
14+
| Test.kt:6:3:6:18 | y | LocalVariableDeclExpr | Test.kt:7:3:7:16 | var ...; | LocalVariableDeclStmt |
15+
| Test.kt:6:17:6:18 | 50 | LongLiteral | Test.kt:6:3:6:18 | y | LocalVariableDeclExpr |
16+
| Test.kt:7:3:7:16 | var ...; | LocalVariableDeclStmt | Test.kt:7:16:7:16 | 0 | IntegerLiteral |
17+
| Test.kt:7:3:7:16 | z | LocalVariableDeclExpr | Test.kt:8:3:8:16 | var ...; | LocalVariableDeclStmt |
18+
| Test.kt:7:16:7:16 | 0 | IntegerLiteral | Test.kt:7:3:7:16 | z | LocalVariableDeclExpr |
19+
| Test.kt:8:3:8:16 | var ...; | LocalVariableDeclStmt | Test.kt:8:16:8:16 | 0 | IntegerLiteral |
20+
| Test.kt:8:3:8:16 | w | LocalVariableDeclExpr | Test.kt:11:3:16:3 | <Expr>; | ExprStmt |
21+
| Test.kt:8:16:8:16 | 0 | IntegerLiteral | Test.kt:8:3:8:16 | w | LocalVariableDeclExpr |
2222
| Test.kt:11:3:16:3 | ... -> ... | WhenBranch | Test.kt:11:3:16:3 | true | BooleanLiteral |
2323
| Test.kt:11:3:16:3 | ... -> ... | WhenBranch | Test.kt:11:7:11:7 | x | VarAccess |
2424
| Test.kt:11:3:16:3 | <Expr>; | ExprStmt | Test.kt:11:3:16:3 | when ... | WhenExpr |
@@ -128,11 +128,11 @@
128128
| Test.kt:82:1:89:1 | Normal Exit | Method | Test.kt:82:1:89:1 | Exit | Method |
129129
| Test.kt:82:21:89:1 | { ... } | BlockStmt | Test.kt:83:2:88:2 | try ... | TryStmt |
130130
| Test.kt:83:2:88:2 | try ... | TryStmt | Test.kt:83:6:86:2 | { ... } | BlockStmt |
131-
| Test.kt:83:6:86:2 | { ... } | BlockStmt | Test.kt:84:7:84:7 | var ...; | LocalVariableDeclStmt |
132-
| Test.kt:84:7:84:7 | var ...; | LocalVariableDeclStmt | Test.kt:84:11:84:11 | o | VarAccess |
133-
| Test.kt:84:7:84:7 | x | LocalVariableDeclExpr | Test.kt:85:10:85:10 | 1 | IntegerLiteral |
131+
| Test.kt:83:6:86:2 | { ... } | BlockStmt | Test.kt:84:3:84:18 | var ...; | LocalVariableDeclStmt |
132+
| Test.kt:84:3:84:18 | var ...; | LocalVariableDeclStmt | Test.kt:84:11:84:11 | o | VarAccess |
133+
| Test.kt:84:3:84:18 | x | LocalVariableDeclExpr | Test.kt:85:10:85:10 | 1 | IntegerLiteral |
134134
| Test.kt:84:11:84:11 | o | VarAccess | Test.kt:84:11:84:18 | (...)... | CastExpr |
135-
| Test.kt:84:11:84:18 | (...)... | CastExpr | Test.kt:84:7:84:7 | x | LocalVariableDeclExpr |
135+
| Test.kt:84:11:84:18 | (...)... | CastExpr | Test.kt:84:3:84:18 | x | LocalVariableDeclExpr |
136136
| Test.kt:84:11:84:18 | (...)... | CastExpr | Test.kt:86:4:88:2 | catch (...) | CatchClause |
137137
| Test.kt:85:3:85:10 | return ... | ReturnStmt | Test.kt:82:1:89:1 | Normal Exit | Method |
138138
| Test.kt:85:10:85:10 | 1 | IntegerLiteral | Test.kt:85:3:85:10 | return ... | ReturnStmt |
@@ -147,11 +147,11 @@
147147
| Test.kt:91:1:98:1 | Normal Exit | Method | Test.kt:91:1:98:1 | Exit | Method |
148148
| Test.kt:91:22:98:1 | { ... } | BlockStmt | Test.kt:92:2:97:2 | try ... | TryStmt |
149149
| Test.kt:92:2:97:2 | try ... | TryStmt | Test.kt:92:6:95:2 | { ... } | BlockStmt |
150-
| Test.kt:92:6:95:2 | { ... } | BlockStmt | Test.kt:93:7:93:7 | var ...; | LocalVariableDeclStmt |
151-
| Test.kt:93:7:93:7 | var ...; | LocalVariableDeclStmt | Test.kt:93:11:93:11 | o | VarAccess |
152-
| Test.kt:93:7:93:7 | x | LocalVariableDeclExpr | Test.kt:94:10:94:10 | 1 | IntegerLiteral |
150+
| Test.kt:92:6:95:2 | { ... } | BlockStmt | Test.kt:93:3:93:13 | var ...; | LocalVariableDeclStmt |
151+
| Test.kt:93:3:93:13 | var ...; | LocalVariableDeclStmt | Test.kt:93:11:93:11 | o | VarAccess |
152+
| Test.kt:93:3:93:13 | x | LocalVariableDeclExpr | Test.kt:94:10:94:10 | 1 | IntegerLiteral |
153153
| Test.kt:93:11:93:11 | o | VarAccess | Test.kt:93:11:93:13 | ...!! | NotNullExpr |
154-
| Test.kt:93:11:93:13 | ...!! | NotNullExpr | Test.kt:93:7:93:7 | x | LocalVariableDeclExpr |
154+
| Test.kt:93:11:93:13 | ...!! | NotNullExpr | Test.kt:93:3:93:13 | x | LocalVariableDeclExpr |
155155
| Test.kt:93:11:93:13 | ...!! | NotNullExpr | Test.kt:95:4:97:2 | catch (...) | CatchClause |
156156
| Test.kt:94:3:94:10 | return ... | ReturnStmt | Test.kt:91:1:98:1 | Normal Exit | Method |
157157
| Test.kt:94:10:94:10 | 1 | IntegerLiteral | Test.kt:94:3:94:10 | return ... | ReturnStmt |

0 commit comments

Comments
 (0)