You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Kotlin extractor: satisfy internal lint on convergence helpers
The Kotlin internal queries job (odasa-buildutils/kotlin_internal_queries)
flagged two code-quality issues introduced by the K1/K2 convergence helpers.
Both are pure source refactors with no effect on extractor output, so no
.expected files change.
1. possiblyThrowingExpressions.ql / notNullExpr: extractVariableExpr used a
`!!` not-null assertion (`currentDesugarTemp!!.second`) guarded by a
separate `currentDesugarTemp?.first === v` check. The extractor must avoid
`!!` (it can throw and lose a source file). Bind `currentDesugarTemp` to a
local val and null-check it in the `when`, which smart-casts the subsequent
`.first`/`.second` accesses. Behaviour is identical.
2. separated_overloads.ql: two overload groups were split by newly added
helpers, which the lint reports as harder-to-read code:
- `getPsiBasedConstructorBodyLocation` sat between the two
`extractBlockBody` overloads; moved it below both.
- the destructuring helpers (`destructuringContainerK1NameRegex`,
`isDestructuringContainerVariable`,
`getPsiBasedDestructuringContainerLocation`) sat between the
`getPsiBasedLocation(IrVariable)` and `getPsiBasedLocation(IrProperty)`
overloads; moved them below the third overload so all three
`getPsiBasedLocation` overloads are adjacent.
Verified the standalone extractor still compiles under both K2 (2.4.0) and
K1 (1.9.20-Beta).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments