Thoughts on Backward Compatibility
Dukc
ajieskola at gmail.com
Tue Feb 20 12:07:38 UTC 2024
On Tuesday, 20 February 2024 at 09:03:15 UTC, Atila Neves wrote:
>
> In the case of DIP1000 specifically I think maybe Robert's idea
> of moving its checks to `@trusted` may be that way forward, and
> making `@safe` regular GC D. Once I'm done with editions I'm
> going to write a DIP for this.
Please remember that it won't be any better than DIP1000 for
backwards compatibility - in fact it's even worse, since:
- With DIP1000 your slice of static array or pointer to a struct
field will still compile if you didn't happen to escape it. With
Roberts proposal it will always need fixing.
- With Roberts proposal your choices for breaking code are
either removing `@safe` or moving your variables to the heap.
With DIP1000 you can also do either, but you also have a third
choice: adding `scope` annotations.
More information about the Digitalmars-d
mailing list