On Wednesday, 19 August 2015 at 21:56:22 UTC, sigod wrote:
```
T to(string units, T, D)(D td)
```

But what compiler does with this function? How `void` appears in the error message?

There are no arguments used thus `to` is resolved as plain template symbol, not a function. Template that does not resolve to any valid entity is treated as if it had type 'void' in error messages, even if it is not technically true.

Why does it even picks this function? `to` has required argument, apparently it can't be called without one.

When you shadow some symbol with a new declaration in more "local" scope, it gets shadow completely, not just added to overload set. No matter what arguments are used only the new symbol will get used.

Reply via email to