Transition to @safe by default

Dukc ajieskola at gmail.com
Tue Jul 30 16:24:03 UTC 2024


Walter Bright kirjoitti 29.7.2024 klo 20.23:
> To clarify, this will not change attribute inference.

You mean that if auto-inference is on, it'll work as before, instead of 
complaining you're calling `@system` code, right? Makes sense.

However, from your first post:
> 3. calling unattributed functions will not affect attribute inference 

Do you mean an auto-inferred function is still going to be inferred as 
`@safe`, not unattributed, if it calls unattributed functions but not 
`@system` functions? I suspect this would be met with opposition that 
I'd symphatise with, because of this:

```D
// unattributed
extern(c) void free(void*);

// inferred as @safe!
auto foo() => free(new int);
```


More information about the dip.ideas mailing list