D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 10177 - irrelevant compiler error messages: should stop semantic3 passes after 1st error is encountered
Summary: irrelevant compiler error messages: should stop semantic3 passes after 1st er...
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-26 11:17 UTC by thelastmammoth
Modified: 2022-11-29 13:24 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description thelastmammoth 2013-05-26 11:17:05 UTC
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/mailman.1443.1369088668.4724.digitalmars-d-learn@puremagic.com but got no answer)
Comment 1 thelastmammoth 2013-05-30 03:08:29 UTC
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 Don 2013-05-31 07:27:06 UTC
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 Martin Krejcirik 2013-06-01 14:21:56 UTC
(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 RazvanN 2022-11-29 13:24:31 UTC
I cannot reproduce this. Running `rdmd --force -unittest main.d` on the example in comment 1 yields: test.d(3): Error: undefined identifier `b`.