@safe function with __gshared as default parameter value
john.michael.hall at gmail.com
Wed Apr 8 19:53:03 UTC 2020
On Wednesday, 8 April 2020 at 19:29:17 UTC, Anonymouse wrote:
> It works with `ref int` too.
> __gshared int gshared = 42;
> void foo(ref int i = gshared) @safe
> void main()
> assert(gshared == 42);
> assert(gshared == 43);
Well that definitely shouldn't happen. I would file a bug report.
More information about the Digitalmars-d-learn