Bug 24647 – Non copyable types can’t do postfix increment/decrement

Status
NEW
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2024-07-03T17:20:10Z
Last change time
2024-12-13T19:36:13Z
Assigned to
No Owner
Creator
Bolpat
Moved to GitHub: dmd#18253 →

Comments

Comment #0 by qs.il.paperinik — 2024-07-03T17:20:10Z
While technically, `x++` means `x` is copied and the copy isn’t used, for non-copyable types, that means `x++` can’t compile. Maybe allow postfix increment for non-copyable types if the result isn’t used and make it mean `++x` (which is what it means for copyable types).
Comment #1 by robert.schadek — 2024-12-13T19:36:13Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18253 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB