[Issue 2962] ICE(glue.c) or bad codegen passing variable as template value parameter

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Feb 6 12:24:41 PST 2011


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



--- Comment #31 from Rainer Schuetze <r.sagitario at gmx.de> 2011-02-06 12:22:16 PST ---
Investigating this a little further, I noticed that when compiling "dmd b a"
the problem seems to be that inner!int is *parsed* before the invocation of the
outer foo, which causes a TemplateInstance to be created. This later causes the
code generation of inner to come first, making the compiler bail out, because
the reference to the parameter of the outer function is not known yet.

As a workaround it seems to work if you put a reference to foo!int where the
parser sees it before inner!int, for example into another file c.d:

module c;
static if(__traits(compiles,foo!int))){}

and the compile it with "dmd c b a".

-- 
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