← Back to index
|
Original Bugzilla link
Bug 21517 – Functions nested within `inout` functions can reinterpret `inout`
Status
NEW
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-12-30T22:29:21Z
Last change time
2024-12-13T19:13:44Z
Assigned to
No Owner
Creator
timon.gehr
Moved to GitHub: dmd#18012 →
Comments
Comment #0
by timon.gehr — 2020-12-30T22:29:21Z
int* g(immutable(int)* y)pure @safe{ int* foo(inout(int)* x)pure @safe{ int* bar(inout(int)* delegate(inout int)pure @safe z){ return z(2); } return bar((inout t)=>x); } return foo(y); } void main()pure @safe{ auto x=new immutable int; int* y=g(x); assert(x is y); // passes, bad }
Comment #1
by robert.schadek — 2024-12-13T19:13:44Z
THIS ISSUE HAS BEEN MOVED TO GITHUB
https://github.com/dlang/dmd/issues/18012
DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB