www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21733] New: inout function does not transfer inout to

https://issues.dlang.org/show_bug.cgi?id=21733

          Issue ID: 21733
           Summary: inout function does not transfer inout to templated
                    return type
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid, spec
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: kyfolee gmail.com

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

--
Mar 19 2021