Mixin template parameter overloading bug?
Andrey Zherikov
andrey.zherikov at gmail.com
Sat Jun 14 01:46:31 UTC 2025
On Saturday, 14 June 2025 at 00:02:32 UTC, Andrey Zherikov wrote:
Simplified test case a bit more.
This works:
```d
template f(void function(int) F) {}
template f(int function(int) F) {}
mixin f!((int _) {});
mixin f!((int _) => 0);
mixin f!((int) {});
mixin f!((int) => 0);
mixin f!((_) {});
mixin f!((_) => 0); // Error: cannot return non-void from `void`
function
```
Can anyone explain why adding type of the parameter in lambda
(`int`) makes this working?
More information about the Digitalmars-d-learn
mailing list