Bug 12502 – Some static array casts incorrectly rejected in safe code

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-04-01T04:10:00Z
Last change time
2017-07-19T17:38:59Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
verylonglogin.reg

Comments

Comment #0 by verylonglogin.reg — 2014-04-01T04:10:00Z
This code should compile: --- void f() @safe { const char[1] arr; auto a1 = cast(const(ubyte)[]) arr[]; // ok auto a2 = cast(const(char) []) arr; // ok auto a3 = cast(const(ubyte)[]) arr; // Error: cast from const(char[1]) to const(ubyte)[] not allowed in safe code } --- Same as issue 11383 but for static arrays.
Comment #1 by k.hara.pg — 2015-02-22T13:09:26Z
Comment #2 by github-bugzilla — 2015-02-27T09:32:35Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/c9f262ad6be7752da581d70dab9341aa585f3e77 fix Issue 12502 - Some static array casts incorrectly rejected in safe code https://github.com/D-Programming-Language/dmd/commit/2670e331d780a8a8f114f5140db9c68c3be00daa Merge pull request #4433 from 9rnsr/fix12502 Issue 12502 - Some static array casts incorrectly rejected in safe code
Comment #3 by github-bugzilla — 2015-06-17T21:01:15Z
Comment #4 by github-bugzilla — 2017-07-19T17:38:59Z
Commits pushed to dmd-cxx at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/c9f262ad6be7752da581d70dab9341aa585f3e77 fix Issue 12502 - Some static array casts incorrectly rejected in safe code https://github.com/dlang/dmd/commit/2670e331d780a8a8f114f5140db9c68c3be00daa Merge pull request #4433 from 9rnsr/fix12502