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

Should we deprecate Seq#lengthCompare and Seq#lengthIs? #11388

Open
NthPortal opened this Issue Feb 1, 2019 · 4 comments

Comments

Projects
None yet
3 participants
@NthPortal
Copy link

NthPortal commented Feb 1, 2019

Should we deprecate Seq#lengthCompare and Seq#lengthIs in favour of Iterable#sizeCompare and Iterable#sizeIs? It doesn't seem necessary to have both, and the size variants are higher up in the hierarchy. I believe this came up in Gitter at some point, though I don't recall when.

Potentially the length variants could be outright removed, though it seems better to have a deprecation cycle.

@NthPortal NthPortal added this to the 2.13.0-RC1 milestone Feb 1, 2019

@NthPortal NthPortal self-assigned this Feb 1, 2019

@NthPortal

This comment has been minimized.

Copy link
Author

NthPortal commented Feb 1, 2019

Deprecating the length variants would also mean that lengthIs is being added in 2.13 in a deprecated state. On the one hand, I think it's important for discoverability, since people are used using lengthCompare; on the other hand, we're telling people to switch to the size variants, so why would you ever use lengthIs?

@som-snytt

This comment has been minimized.

Copy link

som-snytt commented Feb 3, 2019

If a deprecated method is marked inline, is there a best practice for emitting a deprecation warning only if inlining fails or is not enabled by whatever the optimizer option is? Note that Scala deprecations don't include a horizon like Java's forRemoval.

@joshlemer

This comment has been minimized.

Copy link
Member

joshlemer commented Feb 4, 2019

I reckon only having size variants should be enough.

@som-snytt

This comment has been minimized.

Copy link

som-snytt commented Feb 4, 2019

I propose forRemoval scala/scala#7714 but I didn't establish a convention for forwarding methods. I was considering ways (short of scalafix) to make migration due to rename trivial, including avoiding warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment