Skip to content

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

Open
@nigredo-tori

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.

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