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

Header.unapply return type makes pattern matches non-exhaustive #174

Open
nigredo-tori opened this issue Feb 18, 2022 · 0 comments · May be fixed by #175
Open

Header.unapply return type makes pattern matches non-exhaustive #174

nigredo-tori opened this issue Feb 18, 2022 · 0 comments · May be fixed by #175
Labels

Comments

@nigredo-tori
Copy link

Header.unapply returns an Option. From the compiler's point of view, this means that it can potentially fail - meaning a pattern match like this

header match {
  case Header(_, _) => ???
}

is non-exhaustive, and triggers the corresponding compiler lint.

We can fix this by changing the return type of unapply to Some[(String, String)] - see this Scastie.

@nigredo-tori nigredo-tori linked a pull request Feb 18, 2022 that will close this issue
@adamw adamw added the v2 label Aug 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants