Bug 9374 – 'super' should be accessible inside template constraint
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-01-22T17:57:00Z
Last change time
2013-01-22T23:03:19Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
k.hara.pg
Comments
Comment #0 by k.hara.pg — 2013-01-22T17:57:11Z
Following code should work.
class C {}
class D : C
{
static bool test(C) { return true; }
void foo()() if (is(typeof(test(super)))) {}
void bar()() if (is(typeof(super) == C)) {}
}
void main()
{
auto d = new D();
d.foo();
d.bar();
}