All three of these test cases from bug 4269 correctly generate errors, but the errors occur only in the glue layer.
static if(is(typeof(X7))) {}
Y7 X7;
static if(is(typeof(X11.init))) {}
const { Y11 X11; }
static if(is(typeof(X12.init))) {}
enum X12 = Y12;
----
zoo.d(18): Error: variable zoo.X7 had semantic errors when compiling
zoo.d(22): Error: variable zoo.X11 had semantic errors when compiling
zoo.d(26): Error: variable zoo.X12 had semantic errors when compiling
----
They should instead give error messages referring to the undefined Y7, Y11, Y12.
Comment #1 by dlang-bot — 2022-09-15T12:50:51Z
@RazvanN7 updated dlang/dmd pull request #14433 "Fix Issue 9146 - Errors in gagged forward reference declarations are …" fixing this issue:
- Fix Issue 9146 - Errors in gagged forward reference declarations are detected too late.
https://github.com/dlang/dmd/pull/14433
Comment #2 by robert.schadek — 2024-12-13T18:03:17Z