[Issue 21733] New: inout function does not transfer inout to templated return type

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Mar 19 14:56:21 UTC 2021


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 at puremagic.com
          Reporter: kyfolee at 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

--


More information about the Digitalmars-d-bugs mailing list