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

--- Comment #0 from Shin Fujishiro <> 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
test.d(7): Error: template instance test.Test!(_vars_field_0) error
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:
------- You are receiving this mail because: -------

Reply via email to