Skip to content

Fix #4922: unapplySeq mustn't allow arrays #4928

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
Aug 11, 2018

Conversation

Blaisorblade
Copy link
Contributor

@Blaisorblade Blaisorblade commented Aug 10, 2018

Fix #4922 with the "obvious" fix.

If this triggers cyclic errors, the extra check could be moved to PostTyper.

The error message could be improved, since it doesn't mention the specific reason why SQ isn't a valid result type.

12 |      case A(xs: _*) => xs
   |           ^^^^^^^^^
   | SQ is not a valid result type of an unapplySeq method of an extractor()
12 |      case A(xs: _*) => xs
   |                        ^^
   |                        not found: xs

Beware this was a 5-minute job, so haven't thought hard about it.

Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

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

LGTM

@Blaisorblade Blaisorblade self-assigned this Aug 11, 2018
@Blaisorblade Blaisorblade merged commit 17e8921 into scala:master Aug 11, 2018
@Blaisorblade Blaisorblade deleted the fix-4922-unapplySeq-arrays branch August 11, 2018 09:14
@Blaisorblade
Copy link
Contributor Author

Merging as it's an improvement, but @lrytz any feedback is still welcome!

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.

unapplySeq allows arrays
2 participants