[Issue 23300] std.array : array wrongly propagates scopeness of source

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Sep 10 22:41:24 UTC 2022


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

--- Comment #3 from Ate Eskola <Ajieskola at gmail.com> ---
I narrowed down what causes the inference to fail

------
auto fun(int* ptr)
{ // comment out this line and this compiles
  // as does if you explicitly mark either it or the argument scope
  auto r = ptr;
  return new int;
}

@safe int* gun(scope int* ptr){return ptr.fun;}
------

Is the scope inference supposed to behave like this?

--


More information about the Digitalmars-d-bugs mailing list