float init 0 request

Nick Treleaven nick at geany.org
Sun Aug 23 10:09:28 UTC 2026


On Sunday, 23 August 2026 at 00:53:31 UTC, GB wrote:
> D already has:
> - storage exists
> - default value exists
>
> If the compiler had access to more information:
> compiler knowledge -> explicitlyAssigned = false
> compiler knowledge -> explicitlyAssigned = true
>
> Then the following would be possible:
>
> @UNASSIGNED float f; // compiler knows -> explicitlyAssigned = 
> false
> writeln(f);  // ERROR: @UNASSIGNED f has not been is explicitly 
> assigned.

https://dlang.org/changelog/2.113.0.html#dmd.fastdfa.uninitialized

It depends on if the compiler can prove that `f` is still 
uninitialized, which it can't always.



More information about the Digitalmars-d mailing list