By fixing issue 13204, this code should be allowed, but doesn't. template AliasThisTypeOf(T) { static assert(0, T.stringof); // T.stringof is important } template StaticArrayTypeOf(T) { static if (is(AliasThisTypeOf!T AT)) alias X = StaticArrayTypeOf!AT; else alias X = T; static if (is(X : E[n], E, size_t n)) alias StaticArrayTypeOf = X; else static assert(0, T.stringof~" is not a static array type"); } enum bool isStaticArray(T) = is(StaticArrayTypeOf!T); struct VaraiantN(T) { static if (isStaticArray!T) ~this() { static assert(0); } } struct DummyScope { alias A = VaraiantN!C; static class C { A entity; } } Blocking issue 13300.
https://github.com/D-Programming-Language/dmd/pull/3878
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/5b5945a818aca281844a3c029139abd98c08004d fix Issue 13333 - Incorrect error ungagging during the resolution of forward references Improve forward reference resolution in template instantiation with alias - Check needGagging in TemplateInstance::semantic2() - Set TemplateInstance::speculative if global.gag is set in semantic() https://github.com/D-Programming-Language/dmd/commit/78c3fd2965911d191fe05db91ef9d8a5fffd5638 Merge pull request #3878 from 9rnsr/fix13333 Issue 13333 - Incorrect error ungagging during the resolution of forward references
Commit pushed to 2.066 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/9b23adf47fceceafe6b2518092fbbaa041ad962d Merge pull request #3878 from 9rnsr/fix13333 Issue 13333 - Incorrect error ungagging during the resolution of forward references