[Issue 19183] DIP1000 defeated if auto used instead of scope in variable declaration with template this member function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Sep 23 03:12:30 UTC 2019


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

--- Comment #17 from Atila Neves <atila.neves at gmail.com> ---
After reading it again, I think the summary is (copied from earlier) this:

Function template => inferred attributes => scope. But fine, this compiles and
shouldn't:

----------
@safe:

const(int)* gInts;

void main() {
    auto s = MyStruct();
    gInts = s.ptr;
}

struct MyStruct {
    int* ints;
    scope ptr(this This)() { return ints; }
}
----------

--


More information about the Digitalmars-d-bugs mailing list