Bug 8700 – Inner type deduction?

Status
RESOLVED
Resolution
DUPLICATE
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-09-20T10:14:00Z
Last change time
2012-12-20T16:41:05Z
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2012-09-20T10:14:39Z
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)
Comment #1 by k.hara.pg — 2012-12-20T16:41:05Z
*** This issue has been marked as a duplicate of issue 9022 ***