August 24, 2013 [Issue 10880] New: foreach on matrix literal refuses immutable iteration | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=10880 Summary: foreach on matrix literal refuses immutable iteration Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: bearophile_hugs@eml.cc --- Comment #0 from bearophile_hugs@eml.cc 2013-08-24 08:55:18 PDT --- A matrix literal can be assigned to an immutable, but this isn't done in a foreach: void main() { immutable m1 = [[1]]; // OK foreach (immutable v; [[1]]) {} // error } dmd 2.064alpha gives: test.d(3): Error: cannot implicitly convert expression (__aggr4[__key5]) of type int[] to immutable(int[]) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation