Trying to understand DIP1000

Dukc via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri May 5 11:15:19 PDT 2017


On Friday, 5 May 2017 at 18:04:32 UTC, Dukc wrote:
> @safe void killDMan()
> {   auto outer = [RefCountedSlice!int(1)];
>     foreach(ref fail; outer)
>     {   outer = [RefCountedSlice!int(1)];
>         gcActivationAttempt = new int[30000];
>         fail[0] = 24;
>     }
> }

should be

int[] gcActivationAttempt;

@safe void killDMan()
{   auto outer = [RefCountedSlice!int(1)];
     foreach(ref fail; outer[0])
     {   outer = [RefCountedSlice!int(1)];
         gcActivationAttempt = new int[30000];
         fail = 24;
     }
}

but this compiles too




More information about the Digitalmars-d-learn mailing list