Skip to content

Fix #8758: strengthen the precondition for comparing extractors #8789

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 1 commit into from
Apr 24, 2020

Conversation

liufengyun
Copy link
Contributor

Fix #8758: strengthen the precondition for comparing extractors

The extractor StringContext#s.unapplySeq may have different prefix,
thus we may not assume they are the same.

The extractor `StringContext#s.unapplySeq` may have different prefix,
thus we may not assume they are the same.
@nicolasstucki nicolasstucki merged commit 5772538 into scala:master Apr 24, 2020
@nicolasstucki nicolasstucki deleted the fix-8758 branch April 24, 2020 13:15
Comment on lines +82 to +86
/** Whether we may assume the two Unapply the same?
* That is, given the same parameter, returns the same result.
*
* This is more general than purity, as the same `unapply` method may
* take different prefix, thus behaves differently.
Copy link
Member

Choose a reason for hiding this comment

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

I was a bit confused by this description, here's a proposed slightly different version:

Suggested change
/** Whether we may assume the two Unapply the same?
* That is, given the same parameter, returns the same result.
*
* This is more general than purity, as the same `unapply` method may
* take different prefix, thus behaves differently.
/** True if we can assume that the two unapply methods are the same.
* That is, given the same parameter, they return the same result.
*
* We assume that unapply methods are pure, but the same method may
* be called with different prefixes, thus behaving differently.
*/

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.

Unreachable case for String interpolation match
3 participants