June 14, 2019 [Issue 19962] New: [DIP1000] scope on delegate no affect with DIP1000 | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=19962 Issue ID: 19962 Summary: [DIP1000] scope on delegate no affect with DIP1000 Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: doob@me.com The following code snippet compiles successfully WITHOUT DIP1000 enabled: void main(string[] args) @safe @nogc { scope f = () { auto a = args; }; } But compiling the same code WITH DIP100 enabled, the following compile error occurs: main.d(1): Error: function `D main` is @nogc yet allocates closures with the GC main.d(3): main.main.__lambda2 closes over variable args at main.d(1) -- |
Copyright © 1999-2021 by the D Language Foundation