Possible bug of "missing matching more than one candidate" in overload set

monkyyy crazymonkyyy at gmail.com
Fri Feb 13 15:12:16 UTC 2026


On Friday, 13 February 2026 at 14:56:43 UTC, user1234 wrote:
> On Friday, 13 February 2026 at 14:54:44 UTC, monkyyy wrote:
>> Template specialization rules can apply. I think its only a 
>> bug if the order of the declarations effect behavior(which 
>> they do often)
>
> No, order doesn't change which element of set is selected.

Not my point, specialization overrides generic cases; an empty 
list is less generic then a vartatic one.

```d
import std;
void f(int i:0)(){"0".writeln;}
void f(int i:3)(){"3".writeln;}
void f(int i)(){"?".writeln;}
unittest{
   static foreach(I;0..5){
     f!I;
}}
```

Id rather make different rules based off "first match", its a 
mess, but the rules are consistent.


More information about the Digitalmars-d-learn mailing list