1970 – Templated interfaces not matched

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1970 - Templated interfaces not matched
Summary: Templated interfaces not matched
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 major
Assignee: No Owner
URL:
Keywords: patch, rejects-valid
Depends on:
Blocks:
Reported: 2008年04月03日 02:22 UTC by Janice Caron
Modified: 2015年06月09日 01:14 UTC (History)
3 users (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Janice Caron 2008年04月03日 02:22:33 UTC
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 Janice Caron 2008年04月24日 04:31:13 UTC
Increased severity to major, as this issue is blocking progress on Phobos development.
Comment 2 Neia Neutuladh 2009年02月22日 20:25:20 UTC
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 Don 2010年09月03日 11:27:33 UTC
The patch in bug 4173 also fixes this.
Comment 4 Walter Bright 2010年09月11日 17:53:00 UTC
http://www.dsource.org/projects/dmd/changeset/675 


AltStyle によって変換されたページ (->オリジナル) /