digitalmars.D.bugs - [Issue 2712] New: error with passing an array slot as another array length to new
- d-bugmail puremagic.com (23/23) Mar 06 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2712
- d-bugmail puremagic.com (18/18) Jan 27 2010 http://d.puremagic.com/issues/show_bug.cgi?id=2712
- d-bugmail puremagic.com (12/12) Feb 01 2012 http://d.puremagic.com/issues/show_bug.cgi?id=2712
http://d.puremagic.com/issues/show_bug.cgi?id=2712 Summary: error with passing an array slot as another array length to new Product: D Version: unspecified Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: andrei metalanguage.com void foo(uint n, in uint[] x) { auto y = new uint[x[n]]; } void main() { foo(new uint[10]); } Error: need size of rightmost array, not type x[n] --
Mar 06 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2712 Don <clugdbug yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |clugdbug yahoo.com.au Version|unspecified |1.00 This is a parsing error. Workaround: Adding () around the x[n] allows it to compile. void foo(uint n, in uint[] x) { auto y = new uint[ (x[n]) ]; } void main() { foo(7, new uint[10]); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 27 2010
http://d.puremagic.com/issues/show_bug.cgi?id=2712 yebblies <yebblies gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |yebblies gmail.com Resolution| |DUPLICATE *** This issue has been marked as a duplicate of issue 783 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 01 2012