Bug 1970 – Templated interfaces not matched

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2008-04-03T02:22:00Z
Last change time
2015-06-09T01:14:37Z
Keywords
patch, rejects-valid
Assigned to
nobody
Creator
caron800

Comments

Comment #0 by caron800 — 2008-04-03T02:22:33Z
The following code won't compile: interface J(T) {} class A : J!(int) {} void foo(T)(J!(T) j) {} void main() { A a = new A; foo(a); } The error is: foo(T) does not match any function template declaration. And yet it does. Change main to void main() { A a = new A; foo(cast(J!(int))a); } and it compiles just fine. I contend that the explicit cast should not be necessary.
Comment #1 by caron800 — 2008-04-24T04:31:13Z
Increased severity to major, as this issue is blocking progress on Phobos development.
Comment #2 by dhasenan — 2009-02-22T20:25:20Z
This is related to #1715, I think -- at the very least, this would be a workaround for #1715 and #1714 if it worked.
Comment #3 by clugdbug — 2010-09-03T11:27:33Z
The patch in bug 4173 also fixes this.
Comment #4 by bugzilla — 2010-09-11T17:53:00Z