Recursive template expansion
Philippe Sigaud
philippe.sigaud at gmail.com
Mon Mar 1 09:47:49 PST 2010
On Mon, Mar 1, 2010 at 17:26, Norbert Nemec <Norbert at nemec-online.de> wrote:
> Thanks, Philippe, for the elegant workaround!
>
De nada. I vaguely remembered being confronted by this one, but didn't know
it was a bug (my code wasn't as clear as yours). I now realize that my
coding in D is a least partially made of such tricks.
>
> Still I would like to know the reason for my original failure, especially
> since the compiler error message did not contain any line number whatsoever.
> Getting this kind of error message in a large project must be really ugly to
> solve, even if the workaround is so straightforward...
>
What bugs (!) me is that a+(b+c) didn't create an error, whereas (a+b)+c
did... I first tried to define opAdd_r so that the compiler could try
c.opAdd_r((a+b)), but to no avail...
As for the line numbers, yes it's hard and it's reason enough to put this on
bugzilla. Maybe even as 2 different tickets.
I remember having other incomplete error messages some days ago. I should
strive to note them and put them on puremagic.
Philippe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20100301/c2ef1b58/attachment.html>
More information about the Digitalmars-d
mailing list