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.