Skip to content

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

Description

@nigredo-tori

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions