@safe D requires which DIP switches?

Dennis dkorpel at gmail.com
Wed Jan 5 10:47:50 UTC 2022


On Wednesday, 5 January 2022 at 10:05:02 UTC, Atila Neves wrote:
> I talked to Walter about this and I don't think it's the 
> correct fix. I've been looking at how to do it otherwise.

Why not? Given a signature like:
```D
int fun(string s) pure nothrow;
```
You can assume `s` is `scope`, because there's no channel to 
escape it: return value has no pointers, global variables are not 
accessible in a pure function, there are no other parameters to 
assign it to.

But when the signature is this:
```D
int fun(string s) pure;
```
You can assign `s` to an Exception that gets thrown. How would 
you prevent / detect that?



More information about the Digitalmars-d mailing list