Scope checking on static array struct doesn't kick in

Nordlöw via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue May 9 04:52:35 PDT 2017


I've tagged the ref-returning functions (in this case `opSlice`) 
with `return scope` for my statically allocated array struct at

https://github.com/nordlow/phobos-next/blob/master/src/arrayn.d

but for some reason the scope-checking (via -dip1000) allows both

https://github.com/nordlow/phobos-next/blob/bde41f92b5373dd1365ad19ef9d0ecee4eb2d2cd/src/arrayn.d#L350

and

https://github.com/nordlow/phobos-next/blob/bde41f92b5373dd1365ad19ef9d0ecee4eb2d2cd/src/arrayn.d#L390

to compile eventhough the life-time of the slices clearly 
outlives (is defined prior to) the lifetime of the fixed-length 
(stack-allocated) array/string struct instance.

Have I missed something or is this simply not yet supported?


More information about the Digitalmars-d-learn mailing list