[Issue 23579] static locals cannot be initialized with stack locals

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Dec 26 10:41:52 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=23579

Nick Treleaven <nick at geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nick at geany.org

--- Comment #1 from Nick Treleaven <nick at geany.org> ---
Assignment is not initialization. A static variable is only initialised once.
What is your use case? In the example b's previous value is discarded every
time v is called, so why is b static?

--


More information about the Digitalmars-d-bugs mailing list