[Issue 10880] foreach on matrix literal refuses immutable iteration
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Nov 20 07:44:54 PST 2013
https://d.puremagic.com/issues/show_bug.cgi?id=10880
yebblies <yebblies at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords|rejects-valid |
CC| |yebblies at gmail.com
Platform|x86 |All
OS/Version|Windows |All
Severity|normal |enhancement
--- Comment #1 from yebblies <yebblies at gmail.com> 2013-11-21 02:44:52 EST ---
And nor should it. As the error says, [[1]] has type int[][], and you can't
implicitly convert int[] to immutable(int[]).
Asking for initializer-style type inference is an enhancement, and doesn't work
particularly well with the way foreach expands to for.
Alternatives are to use const, or give the aggregate expression an explicit
type.
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list