Bug 7363 – Eponymous Template doesn't hide internal names in some cases with `static if`

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-01-24T13:43:00Z
Last change time
2012-04-21T05:37:41Z
Keywords
accepts-invalid, patch, rejects-valid
Assigned to
nobody
Creator
verylonglogin.reg

Comments

Comment #0 by verylonglogin.reg — 2012-01-24T13:43:06Z
It still works sometimes so I decided not to reopen Issue 4675 but create a new one. Testcases: --- template t() { enum e = 0; static if (true) enum t = 0; } static assert(!__traits(compiles, t!().t == 0)); // Assertion fails static assert(t!() == 0); // Error: void has no value --- and --- template t() { static if (true) { enum e = 0; enum t1 = 0; } alias t1 t; } static assert(!__traits(compiles, t!().t == 0)); // Assertion fails static assert(t!() == 0); // Error: void has no value ---
Comment #1 by verylonglogin.reg — 2012-01-24T14:25:42Z
By the way, I'm trying to get rig of Issue 4675 workarounds in Phobos and I hope as soon as it will build without these workarounds, Eponymous Templates will be considered working.
Comment #2 by k.hara.pg — 2012-01-25T15:19:22Z
Comment #3 by yebblies — 2012-02-03T23:42:04Z
*** Issue 3338 has been marked as a duplicate of this issue. ***
Comment #4 by github-bugzilla — 2012-02-09T08:35:01Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/7b3d07aa5041f478b8008cec2428f5ac41015054 Merge pull request #639 from 9rnsr/fix7363 Issue 7363 - Eponymous Template doesn't hide internal names in some cases with `static if`
Comment #5 by lovelydear — 2012-04-21T05:24:00Z
Compiles and runs on 2.059