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
This is meant as a more actional issue than #16001.
nim check (or --errormax:N) reports redundant errors
Example 1
whentrue:
type E =enum A, B, C
var x = A
var t1 =case x:
of A: "a" of B: "b"# of C: "c"
Current Output
nim r --errormax:10 --listfullpaths:off t11383.nim
t11383.nim(57, 12) Error: not all cases are covered; missing: {C}
t11383.nim(58, 11) Error: expression '"a"' is of type 'string' and has to be used (or discarded)
t11383.nim(59, 11) Error: expression '"b"' is of type 'string' and has to be used (or discarded)
t11383.nim(57, 12) Error: expression 'case x
of A:
"a"
of B:
"b"' has no type (or is ambiguous)
Expected Output
only 1st error message is shown, the other ones are consequence of it and should be gagged
t11383.nim(57, 12) Error: not all cases are covered; missing: {C}
Example 2: found 'bad5' [unknown declared in should not be reported
XDG_CONFIG_HOME= nim check --hints:off --spellsuggest:0 $timn_D/tests/nim/all/t12213.nim
/Users/timothee/git_clone/nim/timn/tests/nim/all/t12213.nim(6, 11) Error: undeclared identifier: 'bad5'
/Users/timothee/git_clone/nim/timn/tests/nim/all/t12213.nim(6, 15) Error: attempting to call routine: 'bad5'
found 'bad5' [unknown declared in /Users/timothee/git_clone/nim/timn/tests/nim/all/t12213.nim(6, 11)]
/Users/timothee/git_clone/nim/timn/tests/nim/all/t12213.nim(6, 15) Error: attempting to call routine: 'bad5'
found 'bad5' [unknown declared in /Users/timothee/git_clone/nim/timn/tests/nim/all/t12213.nim(6, 11)]
/Users/timothee/git_clone/nim/timn/tests/nim/all/t12213.nim(6, 15) Error: expression 'bad5' cannot be called
/Users/timothee/git_clone/nim/timn/tests/nim/all/t12213.nim(6, 15) Error: expression '' has no type (or is ambiguous)
/Users/timothee/git_clone/nim/timn/tests/nim/all/t12213.nim(6, 7) Error: 'let' symbol requires an initialization
Example 3: redundant errors on undeclared routine call
the only thing that should be reported here is Error: undeclared identifier: 'bad5'
/Users/timothee/git_clone/nim/timn/tests/nim/all/t12213.nim(6, 11) Error: undeclared identifier: 'bad5'
/Users/timothee/git_clone/nim/timn/tests/nim/all/t12213.nim(6, 15) Error: attempting to call routine: 'bad5'
found 'bad5' [unknown declared in /Users/timothee/git_clone/nim/timn/tests/nim/all/t12213.nim(6, 11)]
/Users/timothee/git_clone/nim/timn/tests/nim/all/t12213.nim(6, 15) Error: attempting to call routine: 'bad5'
found 'bad5' [unknown declared in /Users/timothee/git_clone/nim/timn/tests/nim/all/t12213.nim(6, 11)]
/Users/timothee/git_clone/nim/timn/tests/nim/all/t12213.nim(6, 15) Error: expression 'bad5' cannot be called
/Users/timothee/git_clone/nim/timn/tests/nim/all/t12213.nim(6, 15) Error: expression '' has no type (or is ambiguous)
/Users/timothee/git_clone/nim/timn/tests/nim/all/t12213.nim(6, 7) Error: 'let' symbol requires an initialization
This is meant as a more actional issue than #16001.
nim check (or --errormax:N) reports redundant errors
Example 1
Current Output
nim r --errormax:10 --listfullpaths:off t11383.nim
Expected Output
only 1st error message is shown, the other ones are consequence of it and should be gagged
Example 2:
found 'bad5' [unknown declared in
should not be reportedas of 01bca8c:
Example 3: redundant errors on undeclared routine call
the only thing that should be reported here is
Error: undeclared identifier: 'bad5'
as of 01bca8c:
Possible Solution
nkError
(but see Nimsuggest misleads, but newcomers use it by default #16001 (comment)) or some other name, eg:nkPoison
(nkNone already is used in nim repo and would be confusing) to gag redundant errors and preventing them bubbling up, as described in , as described in Nimsuggest misleads, but newcomers use it by default #16001 (comment) and https://forum.dlang.org/thread/[email protected]?page=2Some gagging already occurs in some cases but it seems more by accident than by design, eg see #16001 (comment)
Additional Information
The text was updated successfully, but these errors were encountered: