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

support val with pattern of > 22 subpats #8468

Open
scabug opened this issue Apr 2, 2014 · 5 comments

Comments

@scabug
Copy link

commented Apr 2, 2014

I tried this in a standalone App object and in the REPL with identical outcome.

Reproduce code:

  type A = Int
  case class Foo(a: A, b: A, c: A, d: A, e: A, f: A, g: A, h: A, i: A, j: A, k: A, l: A, m: A, n: A, o: A, p: A, q: A, r: A, s: A, t: A, u: A, v: A, w: A, x: A, y: A, Z: A)
  val foo = Foo(1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6)
  val Foo(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z) = foo

Expected result:
compiles fine

Actual result:

[error] object <none> is not a member of package scala
[error]   val Foo(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z) = foo
[error]          ^
[error] one error found

Same happens for

val Foo(1,2,3,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z) = foo

But not for

val Foo(1,2,3,4,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z) = foo

which compiles fine, as it matches only 22 values.

@scabug

This comment has been minimized.

Copy link
Author

commented Apr 2, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8468?orig=1
Reporter: @cvogt
Affected Versions: 2.11.0-RC3
See #7296

@scabug

This comment has been minimized.

Copy link
Author

commented Apr 2, 2014

@adriaanm said:
This is not a blocker since it's a new feature (thus not a regression) and it has a workaround:

 foo match { case Foo(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z) => }
@scabug

This comment has been minimized.

Copy link
Author

commented Apr 2, 2014

@adriaanm said:
The problem with the value definition that uses a pattern is that its translation uses Option[TupleN] under the hood, and we don't have enough tuples :-)

@scabug

This comment has been minimized.

Copy link
Author

commented Apr 2, 2014

@xeno-by said:
What about name-based patmat?

@scabug

This comment has been minimized.

Copy link
Author

commented Nov 4, 2014

@retronym said:
Reassinging to 2.11.5, 2.11.4 has already been released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.