Error: @nogc function 'test.func2' cannot call non- at nogc delegate 'msg'

Shachar Shemesh shachar at weka.io
Sun Dec 10 10:54:00 UTC 2017


void func1(scope lazy string msg) @nogc {
}

void func2(scope lazy string msg) @nogc {
     func1(msg);
}

What? Why is msg GC allocating, especially since I scoped the lazy? Why 
is msg even evaluated?

Something seems off here.

Thanks,
Shachar


More information about the Digitalmars-d mailing list