[Issue 14174] New: Weird IFTI deduction failure

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Feb 12 06:48:26 PST 2015


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: nobody at puremagic.com
          Reporter: k.hara.pg at gmail.com

From: http://forum.dlang.org/thread/jbxscocwxabfwoatjsxa@forum.dlang.org

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...)()

--


More information about the Digitalmars-d-bugs mailing list