immutable(int)[] bar(immutable(int)[] x){return x;} int[] bar(int[] x){return x;} immutable(int)[] foo(immutable(int)[] x, float f){return x;} int[] foo(int[] x, float f){return x;} void main(){ bar([1,2,3]); // fine, second version is chosen foo([1,2,3],4);// currently an error } Both foos are a convert match, and neither one is deduced more specialized by the current rules. I propose to add the following intuitive rule to improve the programmer-conceived language consistency: "If a parameter type better matches the argument type than another one, it is considered to be more specialized." This will make the foo invocation call the second overload, consistent with how bar is handled.
Language change
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18410 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB