[Issue 10228] New: Type deduction fails with dependencies between parameter types

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jun 1 04:10:18 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10228

           Summary: Type deduction fails with dependencies between
                    parameter types
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: peter.alexander.au at gmail.com


--- Comment #0 from Peter Alexander <peter.alexander.au at gmail.com> 2013-06-01 04:10:17 PDT ---
This fails with the error: "undefined identifier T.Inner" in 2.063

void foo(T)(T x, T.Inner y) {}

struct Bar { alias int Inner; };

void main()
{
    foo(Bar(), 0);
}

Calling foo!Bar works.


I don't know if this is really a bug, or an enhancement request, but analogous
code works in C++:

template <typename T>
void foo(T x, typename T::Inner y) {}

struct Bar { typedef int Inner; };

int main()
{
    foo(Bar(), 0);
    return 0;
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list