Describe the bug
W010 (duplicate dict key) is never reported for a dict literal inside an unobserved: block or a match arm. check_dup_keys recurses through expressions and the IF/FUNC/RETURN/FOR/LOOP/PROGRAM/TRY/LIST node types, but AST_MATCH (src/lint.c:702) and AST_UNOBSERVED (src/lint.c:704) sit in its break-only group, so the literal is never reached and the emission at src/lint.c:631 never fires.
Surfaced while doing #779, which made these switches enumerable; it neither caused nor fixed this. Line numbers resolved against main @ 23edbc25.
To reproduce
Control — reported correctly:
w010_d is {"a": 1, "a": 2}
print of w010_d
Silent — inside unobserved::
unobserved:
w010_d is {"a": 1, "a": 2}
print of w010_d
Silent — inside a match arm:
match 1:
case 1:
w010_d is {"a": 1, "a": 2}
case _:
x is 0
print of 1
Expected behavior
warning[W010]: duplicate dict key 'a' in all three.
Actual behavior
$ eigenscript --lint w010_control.eigs
w010_control.eigs:1: warning[W010]: duplicate dict key 'a'
$ eigenscript --lint w010_unobs.eigs
w010_unobs.eigs: no issues found
$ eigenscript --lint w010_match.eigs
w010_match.eigs: no issues found
Environment
- OS: Debian 13 (x86_64)
- GCC version: 14
- EigenScript version: 0.34.0 (
main @ 23edbc25)
Describe the bug
W010(duplicate dict key) is never reported for a dict literal inside anunobserved:block or amatcharm.check_dup_keysrecurses through expressions and the IF/FUNC/RETURN/FOR/LOOP/PROGRAM/TRY/LIST node types, butAST_MATCH(src/lint.c:702) andAST_UNOBSERVED(src/lint.c:704) sit in its break-only group, so the literal is never reached and the emission atsrc/lint.c:631never fires.Surfaced while doing #779, which made these switches enumerable; it neither caused nor fixed this. Line numbers resolved against
main@23edbc25.To reproduce
Control — reported correctly:
Silent — inside
unobserved::Silent — inside a
matcharm:Expected behavior
warning[W010]: duplicate dict key 'a'in all three.Actual behavior
Environment
main@23edbc25)