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

Fix #11061: stop accidentally supported auto-tupling for case classes #10987

Merged
merged 1 commit into from
Jan 18, 2021

Conversation

liufengyun
Copy link
Contributor

@liufengyun liufengyun commented Jan 4, 2021

Fix #11061: stop accidentally supported auto-tupling for case classes

This commit refactor the PR #5259 so that it will not impact pattern
matching code.

library/src/scala/Tuple.scala Outdated Show resolved Hide resolved
@liufengyun
Copy link
Contributor Author

@nicolasstucki: is this one ready to go, given that there is no consensus on #11008?

@liufengyun
Copy link
Contributor Author

@nicolasstucki Can we merge this as it fixes #10958 and accidentally supported language features:

  • tests/pos/i6199a.scala
  • scala3doc/src/dotty/renderers/MemberRenderer.scala

Then we can think about how to support the new feature in #11008 .

@nicolasstucki
Copy link
Contributor

Why not fix #11008. If we merge this one we would need to open an extra issue to revert the X *: EmptyTuple -> Tuple1[X] change. Seems unnecessarily complicated. This new issue would affect code than #10958.

@liufengyun
Copy link
Contributor Author

we would need to open an extra issue to revert the X *: EmptyTuple -> Tuple1[X] change.

We can revert that line of change in this PR and add it as a neg test.

The rationale for merging this is that it fixes another important issue #11061: the accidentally supported auto-untupling of case classes.

  • tests/pos/i6199a.scala
  • scala3doc/src/dotty/renderers/MemberRenderer.scala

The code changes of this PR mainly target the bug #11061.

@liufengyun liufengyun changed the title Fix #10958: handle tupling for generic tuples without affecting patmat Fix #110661: stop accidentally supported auto-tupling for case classes Jan 11, 2021
@liufengyun liufengyun linked an issue Jan 11, 2021 that may be closed by this pull request
@liufengyun liufengyun changed the title Fix #110661: stop accidentally supported auto-tupling for case classes Fix #11061: stop accidentally supported auto-tupling for case classes Jan 12, 2021
@nicolasstucki
Copy link
Contributor

@liufengyun there is a small conflict with master

This commit refactor the PR scala#5259 so that it will not impact pattern
matching code.

scala#5259

- tests/pos/automatic-tupling-of-function-parameters.scala

  This test requires dealiasing.

- tests/run/function-arity.scala

  This test requires widen ExprType.
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.

Incorrectly supported auto-tupling for case classes
3 participants