Bug 1178 – templates - deduction + specialization won't compile

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2007-04-23T06:45:00Z
Last change time
2014-02-16T15:23:59Z
Assigned to
bugzilla
Creator
leo.dahlmann

Comments

Comment #0 by leo.dahlmann — 2007-04-23T06:45:16Z
The following code won't compile with these error messages: templates.d(11): template templates.test!(double).foo(T) does not match any temp late declaration templates.d(11): template templates.test!(double).foo(T) cannot deduce template function from argument types (double,char[2]) template test(R) { R foo(T)(float x, T param) { return cast(R)x; } } void main() { test!(double).foo(5.0, "hi"); }
Comment #1 by thomas-dloop — 2007-04-27T12:35:53Z
Workaround: use "5.0f" in istead of "5.0" *** This bug has been marked as a duplicate of 617 ***