Bug 21733 – inout function does not transfer inout to templated return type
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-03-19T14:56:21Z
Last change time
2021-03-19T17:30:18Z
Keywords
rejects-valid, spec
Assigned to
No Owner
Creator
Kyle Foley
Comments
Comment #0 by kyfolee — 2021-03-19T14:56:21Z
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 by dfj1esp02 — 2021-03-19T17:23:24Z
That's by design.
*** This issue has been marked as a duplicate of issue 9983 ***