[Issue 8121] "scope ref" is perfectly OK

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Oct 13 19:39:48 PDT 2014


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

--- Comment #7 from Marco Leise <Marco.Leise at gmx.de> ---
The meaning is very clear: This reference is not going to outlive the function
scope. The compiler implementation is lacking behind on static checks, but
that's not a reason to disallow it or for the current schizophrenic behavior
where `scope int*` is allowed but `scope ref int` is an error.

(Personally I expect some limited lifetime checks to be coming to D in the
future. If just for the sake of passing different pointer types (stack, RC,
heap) uniformly to such functions that take scope pointers.)

--


More information about the Digitalmars-d-bugs mailing list