www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8700] New: Inner type deduction?

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8700

           Summary: Inner type deduction?
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



Maybe according to D specs this is not supposed to work, but is this good to
support? It's useful as inner types are becoming more and more common in D
code:


struct Tree1 {
    static struct Node { int x; }
}
struct Tree2 {
    static struct Node { int x, y; }
}
void foo(T)(T.Node n1, T.Node n2) {} // ***
void main() {
    Tree1.Node n1, n2;
    foo(n1, n2);
}



DMD 2.061alpha gives:

temp.d(10): Error: undefined identifier T.Node
temp.d(10): Error: template temp.foo does not match any function template
declaration
temp.d(10): Error: template temp.foo(T) cannot deduce template function from
argument types !()(Node,Node)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 20 2012
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8700


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE



*** This issue has been marked as a duplicate of issue 9022 ***

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