D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21733 - inout function does not transfer inout to templated return type
Summary: inout function does not transfer inout to templated return type
Status: RESOLVED DUPLICATE of issue 9983
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: rejects-valid, spec
Depends on:
Blocks:
 
Reported: 2021-03-19 14:56 UTC by Kyle Foley
Modified: 2021-03-19 17:30 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 Kyle Foley 2021-03-19 14:56:21 UTC
struct A(T)
{
    T t;
}

A!(inout(int)) not_working(inout(int)); // Error: variable `example.A!(inout(int)).A.t` only parameters or stack based variables can be `inout`


---

dmd 2.094.2

---

https://dlang.org/spec/function.html#inout-functions
Comment 1 anonymous4 2021-03-19 17:23:24 UTC
That's by design.

*** This issue has been marked as a duplicate of issue 9983 ***
Comment 2 anonymous4 2021-03-19 17:30:18 UTC
Also issue 15651.