Annoyance with new integer promotion deprecations

Johan Engelen j at j.nl
Sun Feb 18 19:42:07 UTC 2018


On Sunday, 18 February 2018 at 19:26:43 UTC, Manu wrote:
>
> The 'solution' so add cast(int) and then cast back is not okay. 
> I have code
> that does a lot of work on bytes/shorts (colour components are 
> small
> integers that receive a lot of maths), and most lines get 3-4 
> times longer
> because of these casts...
> I can't accept that.
>
> If change the behaviour (is done), then just let the code be 
> broken! Emitting these terrible noises, and encouraging people 
> to make their code even noisier than the compiler output is 
> much worse than broken code.

Silently breaking code by changing language semantics is not an 
option; we do that accidentally sometimes and it makes upgrading 
to a newer compiler very very hard on large codebases. Let's 
cherish the few users of D in production code. The deprecation 
messages are annoying perhaps, but necessary.

> There are hundreds of lines I need to molest to make the 
> compiler shut up. I won't type another line of code on my 
> colour library until this noise is gone... I will not maintain 
> it. I am emotionally incapable of assaulting my code with those 
> casts.

Using the `-transition=intpromote` compile flag is no option for 
you?

- Johan



More information about the Digitalmars-d mailing list