www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23458] New: No template candidates listed when

https://issues.dlang.org/show_bug.cgi?id=23458

          Issue ID: 23458
           Summary: No template candidates listed when OverDeclaration or
                    OverloadSet don't match
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: nick geany.org

dmd should list overload candidates rather than just saying none of the
overloads are callable:

template Foo(T) if (is(T == int)) {}
template Bar(T) if (is(T == double)) {}

alias X = Foo;
alias X = Bar;
// in here, X is an OverDeclaration

template Mix1() { alias M = Foo; }
template Mix2() { alias M = Bar; }
mixin Mix1;
mixin Mix2;
alias Y = M;
// in here, Y is an OverloadSet

void main()
{
    func("abc");
    alias x = X!string;
    alias y = Y!string;
}

PR incoming.

--
Nov 04 2022