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

Pattern matching fails on method-local case class with more than 22 members #9567

Closed
scabug opened this issue Nov 24, 2015 · 3 comments
Closed
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Nov 24, 2015

The following code fails to compile, thus reproducing the issue:

@Test
  def testMethodLocalCaseClass {
    case class MethodLocalWide(
             f01: Int, f02: Int, f03: Int, f04: Int, f05: Int, f06: Int, f07: Int, f08: Int, f09: Int, f10: Int,
             f11: Int, f12: Int, f13: Int, f14: Int, f15: Int, f16: Int, f17: Int, f18: Int, f19: Int, f20: Int,
             f21: Int, f22: Int, f23: Int)

    val instance = MethodLocalWide(0, 0, 0,0, 0, 0,0, 0, 0, 0, 0, 0,0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0)
    val result = instance match {
      case MethodLocalWide(0, 0, 0,0, 0, 0,0, 0, 0, 0, 0, 0,0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0) => true
      case _ => false
    }
    assertTrue(result)
  }

Moving the case class out of the method, or reducing the number of parameters to 22 works.

@scabug
Copy link
Author

scabug commented Nov 24, 2015

Imported From: https://issues.scala-lang.org/browse/SI-9567?orig=1
Reporter: @triggerNZ
Affected Versions: 2.11.7

@scabug
Copy link
Author

scabug commented Nov 24, 2015

@retronym said:
scala/scala#4862

@scabug scabug closed this as completed Dec 18, 2015
@scabug
Copy link
Author

scabug commented Dec 18, 2015

@milessabin said:
Awesome ... thanks:-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants