Files
codeql/java/kotlin-extractor
Anders Fugmann 79948931ab Converge bare-assignment ExprStmt wrapper locations onto K2
The K1 frontend records an assignment's raw end offset at its left-hand
side rather than past its right-hand value, so the ExprStmt wrapper
synthesised around a bare assignment statement (`z = 4`) collapses onto the
LHS and produces a zero-width span. K2 spans the whole assignment.

Widen the ExprStmt wrapper location to end past the assigned value via a new
`getExpressionStmtLocation` helper (reusing `correctedEndOffset`). This makes
the wrapper match the inner `AssignExpr`, which already uses
`e.startOffset .. rhsValue.endOffset`. The helper is a no-op for
non-assignments and under K2, where the assignment already spans its value.

Example (stmts.kt:17):
  before: 17:37:17:37 (collapsed onto LHS `z`)
  after:  17:37:17:41 (spans `z = 4`, matching K2)

Only the K1 (test-kotlin1) expected files change; the K2 (test-kotlin2)
expected files are unchanged. Controlflow expected files converge as a pure
cascade of the location shift (dominator.expected fully converges).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-11 15:59:35 +02:00
..
2022-05-10 18:45:56 +01:00
2025-05-13 14:42:05 +01:00
2022-05-10 18:45:51 +01:00