digitalmars.D.bugs - [Issue 5903] New: Overloading template functions with typeof() parameter type fails.
- d-bugmail puremagic.com (47/47) Apr 28 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5903
- d-bugmail puremagic.com (16/16) Apr 23 2012 http://d.puremagic.com/issues/show_bug.cgi?id=5903
- d-bugmail puremagic.com (11/11) Apr 23 2012 http://d.puremagic.com/issues/show_bug.cgi?id=5903
http://d.puremagic.com/issues/show_bug.cgi?id=5903 Summary: Overloading template functions with typeof() parameter type fails. Product: D Version: D2 Platform: Other OS/Version: Mac OS X Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: kennytm gmail.com --- Comment #0 from kennytm gmail.com 2011-04-28 12:18:38 PDT --- Test case: --------------------------------------------------- static assert(is(int == typeof(0))); void p()(int a) { pragma(msg, "OK(p)"); } void p()() { pragma(msg, "Err(p)"); } void r(R=typeof(0))(R a) { pragma(msg, "OK(r)"); } void r()() { pragma(msg, "Err(r)"); } void s()(typeof(0) a) { pragma(msg, "OK(s)"); } void t(typeof(0) a) { } void t() { } void q()(typeof(0) a) { pragma(msg, "OK(q)"); } void q()() { pragma(msg, "Err(q)"); } void main() { p!()(5); // without typeof() is ok r!()(5); // put that typeof() elsewhere is ok s!()(5); // no overloading is ok t(5); // no template is ok q!()(5); // Error } --------------------------------------------------- OK(p) OK(r) OK(s) x.d(22): Error: template x.q() does not match any function template declaration x.d(22): Error: template x.q() cannot deduce template function from argument types !()(int) x.d(22): Error: template instance errors instantiating template --------------------------------------------------- Probably the same as issue 4413, except it affects more than typeof(this). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 28 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5903 SomeDude <lovelydear mailmetrash.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lovelydear mailmetrash.com --- Comment #1 from SomeDude <lovelydear mailmetrash.com> 2012-04-23 12:54:21 PDT --- Compiles with 2.059 Win32. PS E:\DigitalMars\dmd2\samples> dmd bug.d OK(p) OK(r) OK(s) OK(q) PS E:\DigitalMars\dmd2\samples> -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 23 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5903 Kenji Hara <k.hara.pg gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |DUPLICATE --- Comment #2 from Kenji Hara <k.hara.pg gmail.com> 2012-04-23 17:04:51 PDT --- *** This issue has been marked as a duplicate of issue 4413 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 23 2012