[Bug 77] New: After a compile error occurs, all template instances fail
Kyle Furlong
kylefurlong at gmail.com
Fri Mar 31 03:15:17 PST 2006
d-bugmail at puremagic.com wrote:
> http://d.puremagic.com/bugzilla/show_bug.cgi?id=77
>
> Summary: After a compile error occurs, all template instances
> fail
> Product: D
> Version: 0.150
> Platform: All
> OS/Version: Windows
> Status: NEW
> Severity: major
> Priority: P2
> Component: DMD
> AssignedTo: bugzilla at digitalmars.com
> ReportedBy: clugdbug at yahoo.com.au
>
>
> This is the simplest example I could come up with. If you swap the order of
> line(10) and line(11), you just get "undefined identifier b". With the order as
> written, the correct error is followed by spurious error messages:
>
> mar30.d(10): undefined identifier b
> mar30.d(11): voids have no value
> mar30.d(11): cannot implicitly convert expression (dog!(int)) of type void to
> in
> t
>
> And with a real project, thousands of lines of incorrect error messages can be
> generated by a single typo! In fact, I now encounter this bug every time I get
> any error message at all. I'd rank it as the most annoying bug in DMD. I
> consider this severity=major -- I've had to temporarily abandon some of my
> metaprogramming work because of it.
>
> -------
> template dog(pig) {
> const int dog=2;
> }
>
> void main() {
> int a;
> a=b; // line (10)
> a = dog!(int); // line (11)
> }
>
>
Yeah I we've been talking about this for a while, definitely a must fix.
More information about the Digitalmars-d-bugs
mailing list