Bug 4903 – opopAssignRight is needed for operator overloading

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-09-20T19:02:14Z
Last change time
2024-12-13T17:53:26Z
Assigned to
No Owner
Creator
Don
Moved to GitHub: dmd#18301 →

Comments

Comment #0 by clugdbug — 2010-09-20T19:02:14Z
Cases where it is required are limited, but one example is BigInt. int x = 14; BigInt y = 3; x = x / y; // OK. x /= y; // No way to support this Applies to /= and %=.
Comment #1 by witold.baryluk+d — 2010-10-31T05:57:50Z
I would also like this feature. One of the reason this is not supported, is that in fact int x = 14; BigInt y = 3; x = x/y; is, actually x = cast(int)(x/y); And there is no way to change type in opAssign (old opXXXAssign).
Comment #2 by robert.schadek — 2024-12-13T17:53:26Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18301 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB