Bug 9657 – static if (is(typeof(&method))) broken with "final" and template mixins
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-03-06T16:42:34Z
Last change time
2020-05-25T08:06:36Z
Keywords
rejects-valid
Assigned to
No Owner
Creator
Vladimir Panteleev
Comments
Comment #0 by dlang-bugzilla — 2013-03-06T16:42:34Z
mixin template InnerMixin()
{
void method() {}
}
mixin template OuterMixin()
{
final: // This is important for some reason
mixin InnerMixin;
// For some reason, this assert passes,
// even though the "static if" does not
static assert(is(typeof(&method)));
// Uncomment this line to get things working:
//void moreMagic() {}
static if (!is(typeof(&method)))
static assert(false, "No 'method' in current context");
}
class Class
{
mixin OuterMixin;
}