February 17, 2019 [Issue 19682] New: Unused alias causes @nogc error | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=19682 Issue ID: 19682 Summary: Unused alias causes @nogc error Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: andy.pj.hanson@gmail.com ```d @nogc: void foo(alias cb)() {} void main() { int x = 0; foo!(() => x)(); } ``` I would expect the code to compile since the closure is inside an alias. The code does compile if I change `foo` to `void foo(alias cb)() { cb(); }`. -- |
Copyright © 1999-2021 by the D Language Foundation