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

           Summary: Repeated template instantiations with the same symbol
                    argument fails
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: rsi...@gmail.com


--- Comment #0 from Shin Fujishiro <rsi...@gmail.com> 2010-09-21 18:41:06 PDT 
---
The following valid code doesn't compile:
--------------------
template Test(alias symbol) {}

struct S(T...)
{
    T vars;                         // (5)
    alias Test!(vars[0]) first;
    alias Test!(vars[0]) second;    // (7)
}
alias S!(int) a;                    // (9)
--------------------
% dmd -o- -c test.d
test.d(5): Error: expression _vars_field_0 is not a valid template value
argument
test.d(7): Error: template instance test.Test!(_vars_field_0) error
instantiating
test.d(9):        instantiated from here: S!(int)
--------------------

The first instantiation of the Test with a symbol argument vars[0] succeeds. 
But the second instantiation fails.  The error does not occur if the line (7)
is commented out.

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

Reply via email to