[Issue 14348] New: typeof(x).ident is not accepted as a symbol
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Fri Mar 27 03:14:39 PDT 2015
https://issues.dlang.org/show_bug.cgi?id=14348
Issue ID: 14348
Summary: typeof(x).ident is not accepted as a symbol
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: yebblies at gmail.com
I don't see any reason why this shouldn't work:
class B
{
int foo() { return 0; }
}
class C : B
{
override int foo() { return 1; }
alias superfoo = typeof(super).foo;
alias thisfoo = typeof(this).foo;
}
void main()
{
assert(&B.foo is &C.superfoo);
assert(&C.foo is &C.thisfoo);
}
The current implementation requires the typeof(a).b expression evaluates to
both a type and a symbol, when only a symbol is required.
--
More information about the Digitalmars-d-bugs
mailing list