Skip to content

Incorrectly supported auto-tupling for case classes #11061

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

Closed
liufengyun opened this issue Jan 11, 2021 · 1 comment · Fixed by #10987
Closed

Incorrectly supported auto-tupling for case classes #11061

liufengyun opened this issue Jan 11, 2021 · 1 comment · Fixed by #10987
Assignees
Milestone

Comments

@liufengyun
Copy link
Contributor

liufengyun commented Jan 11, 2021

Minimized code

case class Foo(a: Int, b: Int)

object Test {
  def foo(x: Foo) = List(x).map(_ + _)
  
  def main(args: Array[String]): Unit = println(foo(Foo(3, 4)))
}

Output

The code compiles and runs.

Expectation

The code should be rejected, as in Scala 2.

@liufengyun
Copy link
Contributor Author

I don't know if the feature is intentional. But it seems it is not much used and only leads to difficult to understand code.

@liufengyun liufengyun self-assigned this Jan 12, 2021
liufengyun added a commit that referenced this issue Jan 18, 2021
Fix #11061: stop accidentally supported auto-tupling for case classes
@Kordyjan Kordyjan added this to the 3.0.0 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants