[Issue 12373] New: opDispatch cannot resolve to a non-member template
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Mar 15 09:33:59 PDT 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12373
Summary: opDispatch cannot resolve to a non-member template
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: john.loughran.colvin at gmail.com
--- Comment #0 from John Colvin <john.loughran.colvin at gmail.com> 2014-03-15 16:33:55 GMT ---
currently you can't have opDispatch resolve to a non-member template:
//break.d
struct A
{
template opDispatch(string s)
{
mixin("alias opDispatch = " ~ s ~ ";");
}
}
struct B()
{
enum blah = 42;
}
unittest
{
alias Q = A.B!();
pragma(msg, Q.blah);
}
$ rdmd -unittest break.d
break.d(1): Error: struct f477.A template identifier 'B' is not a member of
'struct A'
break.d(1): Error: struct f477.A template identifier 'B' is not a member of
'struct A'
42
As you can see, the code works, 42 is the answer! Unfortunately there's the
error...
note: I'm not sure whether this is a bug report or an enhancement request, as I
don't know what the current design is supposed to allow.
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list