digitalmars.D.bugs - [Issue 2626] New: template function not working against template struct instantiated with default arguments
- d-bugmail puremagic.com (32/32) Jan 27 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2626
- d-bugmail puremagic.com (11/11) Feb 28 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2626
- d-bugmail puremagic.com (9/9) Apr 01 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2626
http://d.puremagic.com/issues/show_bug.cgi?id=2626 Summary: template function not working against template struct instantiated with default arguments Product: D Version: unspecified Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: andrei metalanguage.com The following code doesn't compile: struct S(T, int x = 1){} S!(T, x) fun(T, int x)(T a, S!(T, x) b) {return b;} void main() { S!(int) s; s = fun(2, s); } Error message: ./test.d(nn): template test.fun(T,int x) does not match any function template declaration ./test.d(nn): template test.fun(T,int x) cannot deduce template function from argument types !()(int,S!(int)) ./test.d(nn): Error: cannot implicitly convert expression ((fun(T,int x))(2,s))of type int to S!(int) Changing the definition of s to: S!(int, 4) s; makes the code work, so I presume it's a simple bug. --
Jan 27 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2626 Here's a simpler version, but fixing it isn't: struct S(int x = 1){} void fun()(S!(1) b) { } void main() { S!() s; fun(s); } --
Feb 28 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2626 bugzilla digitalmars.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED Fixed DMD 2.027 --
Apr 01 2009