First Draft: Static Single Assignment
Walter Bright
newshound2 at digitalmars.com
Mon Nov 17 01:08:58 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*`?
`final` is not part of the type system. So typeof(&f) would be `int*`.
> ```d
> int i;
> final int* pi = &i;
> auto p = pi;
> ```
> Is `p` final or const?
```d
int* p = pi;
```
More information about the dip.development
mailing list