February 15, 2017 [Issue 17186] New: Type inference for parameters with default argument | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=17186 Issue ID: 17186 Summary: Type inference for parameters with default argument Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: doob@me.com D supports type inference in my places, like variable declarations: auto a = 3; But the same thing doesn't work with parameters, neither template or regular parameters: void foo(auto a = 3); void foo(auto a = 3)(); Implementing this feature would allow for some function signatures to be shorter and make the language more consistent. Currently it seems like an arbitrary limitation. -- |
Copyright © 1999-2021 by the D Language Foundation