April 04, 2022 [Issue 22981] New: Another forward reference bug involving a string mixin | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=22981 Issue ID: 22981 Summary: Another forward reference bug involving a string mixin Product: D Version: D2 Hardware: All OS: All Status: NEW Keywords: rejects-valid Severity: normal Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: maxsamukha@gmail.com A reduced test case: mixin ("enum E {", S.attr, "}"); struct S { E e; enum attr = "a"; } void main() { } onlineapp.d(7): Error: undefined identifier `E` The test case compiles if the enum is wrapped in a template: template E() { mixin ("enum E {", S.attr, "}"); } struct S { E!() e; enum attr = "a"; } -- | ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply