Bug 21348 – Nested function can't return inout without inout parameter

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2020-10-29T04:26:02Z
Last change time
2024-12-13T19:12:22Z
Assigned to
No Owner
Creator
Paul Backus
Moved to GitHub: dmd#19812 →

Comments

Comment #0 by snarwin+bugzilla — 2020-10-29T04:26:02Z
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)() ---
Comment #1 by robert.schadek — 2024-12-13T19:12:22Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19812 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB