Bug 21909 – Scope-ness of parameters of function templates should be inferred
Status
RESOLVED
Resolution
INVALID
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-05-09T20:33:10Z
Last change time
2021-05-09T20:58:49Z
Assigned to
No Owner
Creator
Per Nordlöw
Comments
Comment #0 by per.nordlow — 2021-05-09T20:33:10Z
Typically usage case is `arg` in
auto apply(alias fun, T)(T arg) {
return fun(arg);
}
Another example is parameters of std.format.format(), std.stdio.write(), and std.stdio.writeln().
Comment #1 by snarwin+bugzilla — 2021-05-09T20:58:49Z
As far as I can tell (https://run.dlang.io/is/4tusPN), `scope` is in fact inferred for `arg` in the example given. So this is not an issue with templates genrally, but with `format`, `write`, and `writeln` in particular.