digitalmars.D.bugs - [Issue 21348] New: Nested function can't return inout without inout
- d-bugmail puremagic.com (30/30) Oct 28 2020 https://issues.dlang.org/show_bug.cgi?id=21348
https://issues.dlang.org/show_bug.cgi?id=21348 Issue ID: 21348 Summary: Nested function can't return inout without inout parameter Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: snarwin+bugzilla gmail.com Example program: --- struct S { int i; } inout(S) fun(inout(int) i) { auto nested() { return inout(S)(i); } return nested(); } --- Compiler output from DMD 2.094.0: --- $ dmd -c bug.d bug.d(5): Error: inout on return means inout must be on a parameter as well for pure nothrow nogc safe inout(S)() --- --
Oct 28 2020