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
}
---