[Issue 17401] type inference broken when F and Parameters!F are used

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Mar 27 21:13:13 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=17401

Walter Bright <bugzilla at digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla at digitalmars.com

--- Comment #4 from Walter Bright <bugzilla at digitalmars.com> ---
Minimal test case:

----
  void f(int x) {}

  void wrap(F)(F fn, S!F args) {}

  struct S(F) { }

  void test() {
    wrap(&f, 1);
  }
----

test.d(9): Error: template `test2.wrap` cannot deduce function from argument
 types `!()(void function(int x), int)`, candidates are:
test.d(4):        `test2.wrap(F)(F fn, S!F args)`

--


More information about the Digitalmars-d-bugs mailing list