D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 14174 - Weird IFTI deduction failure
Summary: Weird IFTI deduction failure
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 major
Assignee: No Owner
URL:
Keywords: pull, rejects-valid
Depends on:
Blocks:
 
Reported: 2015-02-12 14:48 UTC by Kenji Hara
Modified: 2017-07-19 17:38 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Kenji Hara 2015-02-12 14:48:26 UTC
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...)()
Comment 2 github-bugzilla 2015-02-18 06:34:30 UTC
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/0c853825e5d3ee0d8cd616a63eca61675b183f63
fix Issue 14174 - Weird IFTI deduction failure

https://github.com/D-Programming-Language/dmd/commit/49d25b3e942e87ac888dfc08450d8fabe6b7484f
Merge pull request #4408 from 9rnsr/fix14174

Issue 14174 - Weird IFTI deduction failure
Comment 5 github-bugzilla 2017-07-19 17:38:33 UTC
Commits pushed to dmd-cxx at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/0c853825e5d3ee0d8cd616a63eca61675b183f63
fix Issue 14174 - Weird IFTI deduction failure

https://github.com/dlang/dmd/commit/49d25b3e942e87ac888dfc08450d8fabe6b7484f
Merge pull request #4408 from 9rnsr/fix14174