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: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Lu�s Marques <[email protected]> 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: -------