www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12880] New: [REG2.066a] Wrong IFTI for string.init argument


          Issue ID: 12880
           Summary: [REG2.066a] Wrong IFTI for string.init argument
           Product: D
           Version: D2
          Hardware: Other
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: sludwig outerproduct.org

The following code  errors out on DMD master (works correctly on previous 
void test(T)(in T value) { static assert(is(T == string)); }
void main() { test(string.init); }

DMD v2.066 DEBUG
bug_dmd_templ.d(1): Error: static assert  (is(const(immutable(char)[]) == 
string)) is false
bug_dmd_templ.d(2):        instantiated from here: 

The "const" should be dropped for the inferred template argument.

Jun 08 2014