Summary: Array literals and AA literals are rejected as
                    template value parameters
           Product: D
           Version: D1 & D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Don <> 2012-10-18 02:41:18 PDT ---
The template spec says that they are valid (both D1 and D2), but

template Bleherg(int[int] X) {}


bug.d(1): Error: arithmetic/string type expected for value-parameter, not
However, the compiler accepts them as template value parameters when used with
in a tuple argument. The example below works correctly with both D1 and D2.
class C ( T ... )
    pragma(msg, "The keys are   ", T[0].keys);
    pragma(msg, "The values are ", T[0].values);

alias C!( [ "abc"[] : 73, "sdg":6 ] ) G1;
alias C!( [ 22354.56 : 273, 43565.12:96 ] ) G2;
Additionally, the name mangling for both array literals and AA literals is
clearly documented in the spec ABI page.

The error message is erroneous.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to