[Issue 1599] New: compile time evaluation with invariant problem
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Fri Oct 19 19:29:15 PDT 2007
    
    
  
http://d.puremagic.com/issues/show_bug.cgi?id=1599
           Summary: compile time evaluation with invariant problem
           Product: D
           Version: 2.006
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: braddr at puremagic.com
This compiles:
template foo(A...) { invariant char[] foo = A[0]; }
static assert(foo!("a") == "a");
This doesnt:
template foo(A...) { invariant(char)[] foo = A[0]; }
static assert(foo!("a") == "a");
The error: static assert  (foo == "a") is not evaluatable at compile time
the difference is the ()'s around char, it's subtle. :)
-- 
    
    
More information about the Digitalmars-d-bugs
mailing list