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

Privatize the deprecated members of immutable.Range. #5198

Merged
merged 2 commits into from Jun 1, 2016

Conversation

sjrd
Copy link
Member

@sjrd sjrd commented May 28, 2016

The implementation of these obscure members of Range are uselessly complicated for the purposes of Range itself. Making them private will allow to relax their semantics to the specific needs of Range, making them simpler, together with the initialization code of Range.

terminalElement becomes dead code and is removed.

Subsequently, we relax the initialization of lastElement not to care about the empty case, since it is only used in code paths where the range is non-empty.

About compatibility with 2.11: this is not the first breaking change of deprecated parts of Range in 2.12. Range was sealed in cb1a452, according to a deprecated inheritance that was added in 2.11. The present PR is arguably a less damaging break than that.

@scala-jenkins scala-jenkins added this to the 2.12.0-M5 milestone May 28, 2016
@sjrd
Copy link
Member Author

sjrd commented May 28, 2016

Review by @Ichoran. Also /cc @adriaanm regarding the 2.11/2.12 compatibility and the possibility of removing deprecated members.

See also the mailing list discussion https://groups.google.com/forum/#!topic/scala-internals/OTfJuM747c0

@sjrd
Copy link
Member Author

sjrd commented May 28, 2016

Hum ... JVM segaults in one run test in each commit (not the same both times).

@sjrd
Copy link
Member Author

sjrd commented May 28, 2016

/rebuild

@Ichoran
Copy link
Contributor

Ichoran commented May 28, 2016

LGTM

@lrytz
Copy link
Member

lrytz commented May 31, 2016

conflit de liaison à cause de #5076..

sjrd added 2 commits May 31, 2016 10:51
The implementation of these obscure members of `Range` are
uselessly complicated for the purposes of `Range` itself.
Making them private will allow to relax their semantics to the
specific needs of `Range`, making them simpler, together with
the initialization code of `Range`.

`terminalElement` becomes dead code and is removed.
`lastElement` is only used in code paths where the range is
non-empty. It is therefore wasteful to try and give it a sort
of sensible value for empty ranges.
@sjrd sjrd force-pushed the privatize-range-members branch from ef3a249 to ec1e804 Compare May 31, 2016 08:51
@sjrd
Copy link
Member Author

sjrd commented May 31, 2016

Rebased.

@lrytz lrytz self-assigned this May 31, 2016
@lrytz
Copy link
Member

lrytz commented Jun 1, 2016

/rebuild -- *** Error in '/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java': free(): invalid pointer: 0x0000000100395c28 ***

@lrytz lrytz merged commit 128ac65 into scala:2.12.x Jun 1, 2016
@sjrd sjrd deleted the privatize-range-members branch June 1, 2016 10:53
@adriaanm adriaanm added 2.12 and removed 2.12 labels Oct 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants