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 ---
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.
https://github.com/D-Programming-Language/dmd/pull/639
*** Issue 3338 has been marked as a duplicate of this issue. ***
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`
Compiles and runs on 2.059