First Draft: Static Single Assignment

monkyyy crazymonkyyy at gmail.com
Sun Dec 7 13:55:51 UTC 2025


On Sunday, 7 December 2025 at 06:02:53 UTC, Walter Bright wrote:
>
> Ironically, this complexity is dealt with via the type system. 
> But final isn't a part of the type system, so things become a 
> morass of special cases.

I suggest maybe this should fail:

```d
@safe:
import std;
unittest {
     const int foo = void;
     foo.writeln;//error @safe const was never initialized
}
```

and then "final assignments" to const are allowed if a value is 
marked as void

```d
unittest{
   const int foo=void;
   goto bar;
   notreal:
     final foo=3;//no op
   bar:
     final foo=5;//allowed cans number flow whatevers sees foo as 
void
   foo.writeln;
}


More information about the dip.development mailing list