First Draft: Static Single Assignment

Nick Treleaven nick at geany.org
Tue Dec 2 20:30:01 UTC 2025


On Tuesday, 2 December 2025 at 07:50:57 UTC, Walter Bright wrote:
> Initial implementation:
>
> https://github.com/dlang/dmd/pull/22171

The (updated) DIP says:

> final has no effect on a ref declaration, as ref cannot be 
> rebound.

It would be more useful if `final ref` meant the pointed-to data 
was `final`. Indeed that's what your PR currently does:

```d
     int j;
     final ref fr = j;
     fr++;
```
```
finalvar.d(25): Error: cannot modify `final fr`
     fr++;
     ^
```


More information about the dip.development mailing list