-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deprecate += and friends for bool and enum #10336
Conversation
lib/system.nim
Outdated
magic: "Dec", noSideEffect.} | ||
## Decrements an ordinal | ||
|
||
proc `*=`*[T: SomeOrdinal|uint|uint64](x: var T, y: T) {. | ||
proc `-=`*[T: enum|bool](x: var T, y: T) {. | ||
magic: "Dec", noSideEffect, deprecated: "use `dec` instead".} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that the deprecation message should include the Nim version starting when that deprecation is effective. That would later help to batch remove deprecations.
If these deprecations are effective starting Nim 0.20, then it's easy to grep for version-specific deprecations and remove all in one go.
Very much related: nim-lang/RFCs#93
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add version numbers that tell when that deprecation went effective
|
||
proc `-=`*[T: SomeOrdinal|uint|uint64](x: var T, y: T) {. | ||
proc `+=`*[T: enum|bool](x: var T, y: T) {. | ||
magic: "Inc", noSideEffect, deprecated: "use `inc` instead".} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
magic: "Inc", noSideEffect, deprecated: "use `inc` instead".} | |
magic: "Inc", noSideEffect, deprecated: "0.20.0, use `inc` instead".} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@krux02 Looks like you didn't merge this suggested edit.
Co-Authored-By: krux02 <arne.doering@gmx.net>
*=
never worked for bool, so didn't implement a deprecation path.fixes #10257