[Issue 13374] New: Wrong template overload resolution when passing function to alias/string parameter

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Aug 24 16:53:17 PDT 2014


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

          Issue ID: 13374
           Summary: Wrong template overload resolution when passing
                    function to alias/string parameter
           Product: D
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: thecybershadow at gmail.com

///// test.d /////
void f(alias a)()
{
}

void f(string s)()
{
}

void x(int i) {}

void main()
{
    f!x();
}
//////////////////

Compiler attempts to evaluate x despite that it's impossible and its return
type is not convertible to a string. But even if x took no arguments and
returned a string, there needs to be a way to pass the function by alias, not
by its evaluation result.

Introduced in https://github.com/D-Programming-Language/dmd/pull/599

--


More information about the Digitalmars-d-bugs mailing list