Skip to content

Give better error when matching too many fields #10757

Closed
@LPTK

Description

@LPTK

I just spent a good amount of time trying to figure out why my code would not compile after a refactoring, because the error message was inadequate.

Minimized example

case class Var(name: String)

@main def f = Var("a") match
  case Var(name, _) => name: String

Output

Found:    (name : Any)
Required: String

Expectation

Too many patterns given in `Var`

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions