← Back to index
|
Original Bugzilla link
Bug 24655 – `inout` breaks invalid `bool` to non-`bool` conversion checks
Status
NEW
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2024-07-09T12:43:22Z
Last change time
2024-12-13T19:36:21Z
Keywords
accepts-invalid, safe
Assigned to
No Owner
Creator
Bolpat
Moved to GitHub: dmd#18255 →
Comments
Comment #0
by qs.il.paperinik — 2024-07-09T12:43:22Z
With the nightly DMD, the following are accepted without deprecation or error (the first fails without `-dip1000`): ```d ref inout(ubyte) asUbyte(return ref inout(bool) x) @safe => *cast(inout ubyte*) &x; inout(ubyte)* asUbyte(return inout(bool)* x) @safe => cast(inout ubyte*) x; inout(ubyte)[] asUbyte(return inout(bool)[] x) @safe => cast(inout ubyte[]) x; ``` Remove `inout` manually and the deprecation warnings appear as expected: ```d ref ubyte asUbyte(return ref bool x) @safe => *cast(ubyte*) &x; ubyte* asUbyte(return bool* x) @safe => cast(ubyte*) x; ubyte[] asUbyte(return bool[] x) @safe => cast(ubyte[]) x; ```
Comment #1
by robert.schadek — 2024-12-13T19:36:21Z
THIS ISSUE HAS BEEN MOVED TO GITHUB
https://github.com/dlang/dmd/issues/18255
DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB