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

          Issue ID: 14174
           Summary: Weird IFTI deduction failure
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid
          Severity: major
          Priority: P1
         Component: DMD
          Assignee: [email protected]
          Reporter: [email protected]

From: http://forum.dlang.org/thread/[email protected]

Following code should work, but doesn't.

struct CborConfig(a, b) {}

struct NonSerialized {}

alias defaultCborConfig = CborConfig!(NonSerialized, NonSerialized);

void accepter(Config : CborConfig!(T) = defaultCborConfig, T...)()
{
    pragma(msg, T);
}

void main()
{
    //accepter!()();  // ok
    accepter();       // Line 15
}

output:

test.d(15): Error: template test.accepter cannot deduce function from argument
types !()(), candidates are:
test.d(7):        test.accepter(Config : CborConfig!T = defaultCborConfig,
T...)()

--

Reply via email to