[Issue 9883] New: Error on using property as new dynamic array size
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Apr 5 06:16:12 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9883
Summary: Error on using property as new dynamic array size
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: verylonglogin.reg at gmail.com
--- Comment #0 from Denis Shelomovskij <verylonglogin.reg at gmail.com> 2013-04-05 17:16:11 MSD ---
---
struct S
{
@property size_t p(T)()
{ return 0; }
}
@property size_t p(T)()
{ return 0; }
void main()
{
S s;
auto n1 = p!int; // OK
auto n2 = s.p!int; // OK
auto a1 = new int[p!int]; // Error: need size of rightmost array, not type
p!(int)
auto a2 = new int[s.p!int]; // Error: no property 'p!(int)' for type 'S'
}
---
Workaround:
Put property in parantheses: `new int[(p!int)]`.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list