D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21909 - Scope-ness of parameters of function templates should be inferred
Summary: Scope-ness of parameters of function templates should be inferred
Status: RESOLVED INVALID
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-09 20:33 UTC by Per Nordlöw
Modified: 2021-05-09 20:58 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Per Nordlöw 2021-05-09 20:33:10 UTC
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 Paul Backus 2021-05-09 20:58:49 UTC
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.