[Issue 11581] New: Given T..., new T[0] does not work
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Fri Nov 22 07:48:36 PST 2013
    
    
  
https://d.puremagic.com/issues/show_bug.cgi?id=11581
           Summary: Given T..., new T[0] does not work
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: luis at luismarques.eu
--- Comment #0 from Luís Marques <luis at luismarques.eu> 2013-11-22 07:48:34 PST ---
I'm not sure, but this seems a bug:
    class X(T...) if(T.length > 0)
    {
        T[0] foo()
        {
            return new T[0];
        }
    }
    class A : X!A {}
Error: can't have array of (A)
Workaround:
    class X(T...) if(T.length > 0)
    {
        T[0] foo()
        {
            alias T0 = T[0];
            return new T0;
        }
    }
-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
    
    
More information about the Digitalmars-d-bugs
mailing list