October 14, 2019 [Issue 20300] New: memoize doesn't work with default params | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=20300 Issue ID: 20300 Summary: memoize doesn't work with default params Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: enhancement Priority: P1 Component: phobos Assignee: nobody@puremagic.com Reporter: trikkuz@gmail.com 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 -- |
Copyright © 1999-2021 by the D Language Foundation