http://d.puremagic.com/issues/show_bug.cgi?id=10687
Summary: Refused cast from uint[] to array of uint-based enums at compile-time Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Keywords: rejects-valid Severity: regression Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: bearophile_h...@eml.cc --- Comment #0 from bearophile_h...@eml.cc 2013-07-20 16:14:49 PDT --- I think this used to be accepted: enum Foo : uint { A, B, C, D, E } void main() { static immutable uint[5] a1 = [0, 1, 2, 3, 4]; // line 3 auto a2 = cast(immutable(Foo[5]))a1; // OK static a3 = cast(immutable(Foo[5]))a1; // line 5, error } test.d(3): Error: cannot implicitly convert expression ([0u, 1u, 2u, 3u, 4u]) of type immutable(uint[5u]) to immutable(Foo[5u]) Also the error line number is wrong, the right line number is 5. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------