Bug 13333 – Incorrect error ungagging during the resolution of forward references

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-08-19T12:33:00Z
Last change time
2014-08-28T04:10:15Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
k.hara.pg
Blocks
13300

Comments

Comment #0 by k.hara.pg — 2014-08-19T12:33:30Z
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.
Comment #1 by k.hara.pg — 2014-08-19T13:25:31Z
Comment #2 by github-bugzilla — 2014-08-20T18:27:09Z
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
Comment #3 by github-bugzilla — 2014-08-28T04:10:15Z
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