First Draft: Static Single Assignment

Walter Bright newshound2 at digitalmars.com
Mon Nov 17 00:50:44 UTC 2025


On 11/16/2025 2:08 PM, Nick Treleaven wrote:
> On Sunday, 16 November 2025 at 01:50:16 UTC, Walter Bright wrote:
>> https://github.com/WalterBright/documents/blob/master/final.md
> 
> ```d
> final int f = 3;
> f = 4; // error, f is final
> int* p = &f; // error, cannot make mutable reference to final variable
> const int* pc = &f; // ok
> ```
> 
> So I assume `typeof(&f)` would be `const int*`?
> 
> ```d
> int i;
> final int* pi = &i;
> auto p = pi;
> ```
> Is `p` final or const?
> 


Great questions! I will think about it.


More information about the dip.development mailing list