[Issue 18567] immutability hole related to context pointers accessed through const pure methods

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jul 29 09:21:23 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=18567

RazvanN <razvan.nitu1305 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |razvan.nitu1305 at gmail.com

--- Comment #1 from RazvanN <razvan.nitu1305 at gmail.com> ---
The code now compiles and prints:

```
0
0
```

So `i` does not change anymore, however, the code is still broken in my
opinion, as it should not compile. Since `s` is immutable, maybe the context
pointer for fun should also be type as immutable?

--


More information about the Digitalmars-d-bugs mailing list