Bug 10177 – irrelevant compiler error messages: should stop semantic3 passes after 1st error is encountered

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-05-26T11:17:05Z
Last change time
2022-11-29T13:24:31Z
Assigned to
No Owner
Creator
thelastmammoth

Comments

Comment #0 by thelastmammoth — 2013-05-26T11:17:05Z
In a number of cases I get large compile error messages after running rdmd main.d Upon inspection, running with -v reveals that the irrelevant error messages are in subsequent semantic3 passes: semantic3 module_with_relevant_error relevant error (eg: Error: no property 'x' for type 'y') semantic3 module_with_irrelevant_error irrelevant error (only coming from the fact that there was an error in a prior semantic pass) ... and the list goes on for large number of lines. Why not just stop semantic3 passes at 1st error occurence ? or at least only show those by default? in all cases i've encountered all that was needed for me to see was the 1st faulty semantic3 pass, all other was irrelevant artifacts stemming from that. I tried to reduce my case through dustmite with no success. Hopefully this is clear enough. (posted on http://forum.dlang.org/post/[email protected] but got no answer)
Comment #1 by thelastmammoth — 2013-05-30T03:08:29Z
ok i managed to reduce with a bit of manual and a bit of dustmite: ------------- main.d: import functional; import test; functional.d: void fun3(){ import std.array:split; enum a=split(``," "); } test.d: import std.stdio; void fun(){ 1==b; //that's where the real error is } -------------- rdmd --force -unittest main.d it spills out lots of irrelevant stuff: test.d(4): Error: undefined identifier b src/phobos/std/algorithm.d(2376): Error: template std.algorithm.find does not match any function template declaration. Candidates are: ... ... functional.d(3): instantiated from here: split!(string, string) functional.d(3): Error: template instance std.array.split!(string, string) error instantiating functional.d(3): Error: CTFE failed because of previous errors in split running with -v i get: semantic3 test test.d(4): Error: undefined identifier b semantic3 functional [irrelevant errors follow] So once again, I see the same cause and probably same solution: stop semantic3 passes at 1st error occurence.
Comment #2 by clugdbug — 2013-05-31T07:27:06Z
I cannot reproduce this. I just get: > rdmd -v --force -unittest main DMD v2.063-devel-1bc8306 DEBUG test.d(3): Error: undefined identifier b Are you using an official DMD? I normally see this kind of behaviour when I've built DMD from git, and haven't run 'make clean' first. (Note that DMD's makefile is completely broken, it has many dependencies missing. If you just type 'make', you'll get a corrupt executable).
Comment #3 by mk — 2013-06-01T14:21:56Z
(In reply to comment #2) > I cannot reproduce this. I just get: I get exactly same message as in #comment 1 (dmd HEAD, rebuild from clean) running dmd -unittest main.d test.d functional.d. Without -unittest I get just one line message.
Comment #4 by razvan.nitu1305 — 2022-11-29T13:24:31Z
I cannot reproduce this. Running `rdmd --force -unittest main.d` on the example in comment 1 yields: test.d(3): Error: undefined identifier `b`.