Skip to content

support val with pattern of > 22 subpats #8468

@scabug

Description

@scabug

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions