[Issue 9934] template default argument should be semantically analysed

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Apr 15 18:46:06 PDT 2013


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



--- Comment #2 from Kenji Hara <k.hara.pg at gmail.com> 2013-04-15 18:46:04 PDT ---
(In reply to comment #1)
> What if the template is in a mixin template? Or would the change not affect
> this?

Even if the template is used for mixin, default template arguments are
evaluated in declaration side.

alias NonExistent = int;   // [a]
template foo(T = NonExistent)   // [b]
{
    pragma(msg, T); // prints 'int'
}
class C {
    alias NonExistent = string;
    mixin foo;
}

If you comment out line [a], compiler reports "Error: undefined identifier
NonExistent" in line [b].

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