Commit ddbc6bf
Fix JET-flagged may-be-undefined locals in _parse_head/_parse_line (#46)
The QA group's JET linting (added in #40) reports four "local variable
may be undefined" errors that fail CI on main:
- `_parse_head(head::Expr)`: the `if/elseif` over `head.head` had no
fallthrough, so `struct_name`, `type_params`, and `super` were
undefined for any other head. Add an `else` that errors, matching the
existing invalid-usage handling elsewhere in the file. This makes the
function total and removes three of the JET findings.
- `_parse_line(line::Expr)`: `val` was bound only inside `if assignment`
but its binding is visible at the later `if assignment` read site, so
JET cannot prove it defined. Initialize `val = nothing` alongside the
existing `annotation = nothing`; behavior is unchanged since `val` is
only read when `assignment` is true.
Verified locally on Julia 1.12 (CI's `julia 1`): the QA group now passes
(Aqua 11/11, JET 1/1, zero findings). Core group still passes 40/40 on
Julia 1.10, including the invalid-usage assertion.
Co-authored-by: ChrisRackauckas-Claude <accounts@chrisrackauckas.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 480e52f commit ddbc6bf
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| 196 | + | |
| 197 | + | |
196 | 198 | | |
197 | 199 | | |
198 | 200 | | |
| |||
210 | 212 | | |
211 | 213 | | |
212 | 214 | | |
| 215 | + | |
213 | 216 | | |
214 | 217 | | |
215 | 218 | | |
| |||
0 commit comments