Bug 12068 – `enum` as `inout` function parameter isn't enough for `inout` return.

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-02-03T05:01:00Z
Last change time
2017-07-02T17:05:11Z
Keywords
rejects-valid
Assigned to
nobody
Creator
verylonglogin.reg
See also
https://issues.dlang.org/show_bug.cgi?id=15762

Comments

Comment #0 by verylonglogin.reg — 2014-02-03T05:01:01Z
This code should compile: --- enum E { a } inout(int) f(inout E); --- Error: inout on return means inout must be on a parameter as well for inout(int)(inout(E)) ---
Comment #1 by verylonglogin.reg — 2014-11-27T11:34:04Z
Another testcase: --- enum E { a } auto f(inout(E) val) { return val; } --- main.d(3): Error: variable main.f.val inout variables can only be declared inside inout functions main.d(3): Error: inout on return means inout must be on a parameter as well for inout(E)(inout(E) val) ---
Comment #2 by dlang-bugzilla — 2017-07-02T17:05:11Z