simple DIP1000 test fails?

Jonathan M Davis newsgroup.d at jmdavisprog.com
Thu Nov 2 20:07:46 UTC 2017


On Thursday, November 02, 2017 14:03:52 Jonathan M Davis via Digitalmars-d-
learn wrote:
> On Thursday, November 02, 2017 19:53:36 Q. Schroll via Digitalmars-d-learn
> wrote:
> > struct S { ref S id() return { return this; } }
> > void main() { S* p = &S().id(); }
>
> Well, if you make them @safe, it won't compile whether -dip1000 is used or
> not. At the moment, I don't recall whether -dip1000's effects are
> supposed to be limited to @safe code or not though. If they are, then I
> don't think that there's a bug, but if they aren't, then it looks like
> there is.

Though actually, scope isn't used anywhere here, and IIRC, -dip1000 only
comes into affect when scope is used. So, I don't think that -dip1000 really
applies here. But I'm not as well-versed in the ins and outs of DIP 1000 as
I should be, so I could be wrong.

- Jonathan M Davis



More information about the Digitalmars-d-learn mailing list