[Issue 963] New: tuples & array literals: Error: non-constant expression ["abc", "1"]

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Feb 15 01:44:29 PST 2007


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

           Summary: tuples & array literals: Error: non-constant expression
                    ["abc","1"]
           Product: D
           Version: 1.005
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: thomas-dloop at kuehne.cn


# template A(T ...){
#    static assert(2 == T[0].length); 
#    static assert("abc" == T[0][0]);
#    static assert("1" == T[0][1]);
#    const A = T[0]; 
# }
# 
# mixin A!(["abc", "1"]);

Strange, all static asserts pass but "const A = T[0];" fails:

a.d(8): Error: non-constant expression ["abc","1"]


-- 



More information about the Digitalmars-d-bugs mailing list