Issue 20300 - memoize doesn't work with default params
Summary: memoize doesn't work with default params
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86_64 Linux
: P4 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-14 15:51 UTC by Andrea Fontana
Modified: 2024-12-01 16:35 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 Andrea Fontana 2019-10-14 15:51:05 UTC
import std;

int test(int a = 0) { return a; }

alias cached = memoize!test;

void main()
{ 
    cached(0); // Works;
    cached(1); // Works;
    cached();  // Error
}


Error: function std.functional.memoize!(test).memoize(int _param_0) is not callable using argument types ()
onlineapp.d(11):        missing argument for parameter #1: int _param_0
Comment 1 dlangBugzillaToGithub 2024-12-01 16:35:50 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/phobos/issues/10394

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB