Thread overview
[Issue 18380] Integral Promotion Fix 16997 should ignore if ultimate result is cast to original or smaller type
Dec 17, 2022
Iain Buclaw
February 20, 2018
https://issues.dlang.org/show_bug.cgi?id=18380

hsteoh@quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hsteoh@quickfur.ath.cx

--- Comment #1 from hsteoh@quickfur.ath.cx ---
+1000! Having to write monstrosities like `b = cast(ubyte) -cast(int) b;` is
the one thing that ticked me off enough to start a forum discussion about it.

In any case, I've written an infectious wrapper type along the lines suggested
by Luis Marques (IIRC) that hides away this insane cast-o-mania, so I could
just write `b = -b.np` (np stands for No Promote[1], ie., it just truncates)
and it will Just Work(tm) without insanity-inducing nested casts.

[1] np can also stand for "no problem", as in, I don't have to care about squint-inducing casts anymore. :-D

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=18380

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P4

--
December 13
https://issues.dlang.org/show_bug.cgi?id=18380

--- Comment #2 from dlangBugzillaToGithub <robert.schadek@posteo.de> ---
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/17839

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB

--