Skip to content

Fix #2636: Move last phase period assertion #2952

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

Merged
merged 3 commits into from
Aug 5, 2017

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

)

private def checkedIdOverflow(phase: Phase): Phase = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

)

private def checkedIdOverflow(phase: Phase): Phase = {
assert(phase.id <= Periods.MaxPossiblePhaseId)
Copy link
Contributor

Choose a reason for hiding this comment

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

would this ever fail? Phase.id extracts it from the period inside the phase, i.e. it reads a field which you're supposedly testing for overflow.

Copy link
Contributor

Choose a reason for hiding this comment

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

I propose to do the test in Phase.init instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know if it will ever fail, but that was the check that was there before. Probably at some point this was failing.

@nicolasstucki
Copy link
Contributor Author

@DarkDimius merged contents of both PRs

@DarkDimius DarkDimius merged commit 972f6d5 into scala:master Aug 5, 2017
@allanrenucci allanrenucci deleted the fix-#2636 branch December 14, 2017 19:18
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.

2 participants