Re: Bug in D type inferencing

2016-07-02 Thread Hiemlick Hiemlicker via Digitalmars-d
On Saturday, 2 July 2016 at 08:02:30 UTC, John Colvin wrote: On Saturday, 2 July 2016 at 01:20:35 UTC, Hiemlick Hiemlicker wrote: public struct Foo { public void Create(T)(uint delegate(T) c, T param) { } } Foo f; f.Create((x) { }, "asdf"); cannot deduce

Re: Bug in D type inferencing

2016-07-02 Thread John Colvin via Digitalmars-d
On Saturday, 2 July 2016 at 01:20:35 UTC, Hiemlick Hiemlicker wrote: public struct Foo { public void Create(T)(uint delegate(T) c, T param) { } } Foo f; f.Create((x) { }, "asdf"); cannot deduce arguments compiler error. Surely D can figure out that T is a

Re: Bug in D type inferencing

2016-07-02 Thread Patrick Schluter via Digitalmars-d
On Saturday, 2 July 2016 at 01:20:35 UTC, Hiemlick Hiemlicker wrote: public struct Foo { public void Create(T)(uint delegate(T) c, T param) { } } Foo f; f.Create((x) { }, "asdf"); I'm a D noob so take it with a very big grain of salt, but I think that

Bug in D type inferencing

2016-07-01 Thread Hiemlick Hiemlicker via Digitalmars-d
public struct Foo { public void Create(T)(uint delegate(T) c, T param) { } } Foo f; f.Create((x) { }, "asdf"); cannot deduce arguments compiler error. Surely D can figure out that T is a string? If one simply changes this to public struct Foo(T) {