digitalmars.D.bugs - [Issue 7738] New: Can't iterate a std.typecons.Typedef!(int[]) with foreach
- d-bugmail puremagic.com (42/42) Mar 19 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7738
- d-bugmail puremagic.com (12/12) Jan 20 2013 http://d.puremagic.com/issues/show_bug.cgi?id=7738
- d-bugmail puremagic.com (7/8) Jan 20 2013 http://d.puremagic.com/issues/show_bug.cgi?id=7738
http://d.puremagic.com/issues/show_bug.cgi?id=7738 Summary: Can't iterate a std.typecons.Typedef!(int[]) with foreach Product: D Version: D2 Platform: All OS/Version: All Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: Phobos AssignedTo: nobody puremagic.com ReportedBy: bearophile_hugs eml.cc This compiles in DMD 2.059head: alias int[] MyArray; void main() { MyArray arr; foreach (i, item; arr) {} } This doesn't compile: import std.typecons: Typedef; alias Typedef!(int[]) MyArray; void main() { MyArray arr; foreach (i, item; arr) {} } DMD 2.059head gives the error: test.d(5): Error: invalid foreach aggregate arr This simpler code gives the same error: import std.typecons: Typedef; alias Typedef!(int[]) MyArray; void main() { MyArray arr; foreach (item; arr) {} } My main use cases for typedef are with arrays. So this problem makes std.typecons.Typedef not much useful. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Mar 19 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7738 Andrej Mitrovic <andrej.mitrovich gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |andrej.mitrovich gmail.com Resolution| |WORKSFORME 14:08:09 PST --- Works in 2.061 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 20 2013
http://d.puremagic.com/issues/show_bug.cgi?id=7738Works in 2.061A step forward for D language. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 20 2013