Bug 11383 – Some 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
2013-10-30T08:07:00Z
Last change time
2014-04-01T04:10:27Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
verylonglogin.reg

Comments

Comment #0 by verylonglogin.reg — 2013-10-30T08:07:14Z
--- void f() @safe { const char[] 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[]) to const(ubyte)[] not allowed in safe code } ---
Comment #1 by yebblies — 2013-11-17T02:19:38Z
Comment #2 by github-bugzilla — 2013-11-23T12:29:16Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/9a2a8ed2361fae390744f9f32b500b6af43f0a04 Fix Issue 11383 - Some array casts incorrectly rejected in safe code https://github.com/D-Programming-Language/dmd/commit/2e869b97b65287e4ac0eeb0a6d5aa7ea5e8acde4 Merge pull request #2796 from yebblies/issue11383 Issue 11383 - Some array casts incorrectly rejected in safe code
Comment #3 by verylonglogin.reg — 2014-04-01T04:10:27Z
Filed same issue for static arrays: Issue 12502.