Skip to content
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

Merged
merged 2 commits into from
Jan 18, 2019
Merged

Conversation

krux02
Copy link
Contributor

@krux02 krux02 commented Jan 16, 2019

*= never worked for bool, so didn't implement a deprecation path.
fixes #10257

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".}
Copy link
Contributor

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

Copy link
Contributor

@kaushalmodi kaushalmodi left a 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".}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
magic: "Inc", noSideEffect, deprecated: "use `inc` instead".}
magic: "Inc", noSideEffect, deprecated: "0.20.0, use `inc` instead".}

Copy link
Contributor

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.

lib/system.nim Outdated Show resolved Hide resolved
Co-Authored-By: krux02 <arne.doering@gmx.net>
@krux02 krux02 changed the title fixes #10257 deprecate += and friends for bool and enum Jan 17, 2019
@Araq Araq merged commit 8399e0f into nim-lang:devel Jan 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

+= (+ friends) shouldn't be allowed for bool
3 participants