[Issue 3869] Unreasonable error without line number: "recursive template expansion"

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 3 07:13:22 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=3869



--- Comment #3 from Norbert Nemec <Norbert at Nemec-online.de> 2010-03-03 07:13:21 PST ---
Don is partly correct:

The problem that I see is that "recursive template instantiation" is
interpreted and prohibited unnecessarily wide, so my "bug report" can actually
be understood as an "enhancement request".

The example code provided by Don is, however, fundamentally different from my
original case:

A function contained in a template is immediately instantiated together with
its containing template, even if it is not called. This leads to an infinite
loop. It could be avoided, but it would mean a significant conceptual change.

In my case, however, the problem was triggered by a template function contained
in a template. This inner template is only instantiated when needed, so it does
not produce an infinite loop. Simply relaxing the safety check in the compiler
should solve the problem.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list