[Issue 11685] template opDispatch rejects-valid.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 15 08:31:58 PDT 2014


https://d.puremagic.com/issues/show_bug.cgi?id=11685



--- Comment #3 from John Colvin <john.loughran.colvin at gmail.com> 2014-03-15 15:31:54 GMT ---
An even more reduced test-case:

template C(alias F)
{
    template C()
    {
        alias C = F;
    }
}

struct A
{
    template opDispatch(string s)
    {
    mixin("alias opDispatch = C!(." ~ s ~ ");");
    }
}

struct B
{
    enum blah = 42;
}

unittest
{
    alias Q = A.B!();
    pragma(msg, Q.blah);
}

$ rdmd -unittest break.d
break.d(9): Error: struct break.A template identifier 'B' is not a member of
'struct A'
break.d(9): Error: struct break.A template identifier 'B' is not a member of
'struct A'
42
Failed: ["dmd", "-unittest", "-v", "-o-", "break.d", "-I."]



As you can see, it knows the answer, but it is unnecessarily throwing an error.

-- 
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