Skip to content

ujson.Bool.unapply generates match may not be exhaustive warning #456

@lolgab

Description

@lolgab

The following code:

ujson.Bool(true) match {
  case ujson.Bool(v) =>
}

generates the following warning:

ujson.Bool(true) match {
^^^^^^^^^^^^^^^^
match may not be exhaustive.

It would fail on pattern case: False, True

The problem is in the unapply signature:

def unapply(bool: Bool): Option[Boolean] = Some(bool.value)

should instead be:

def unapply(bool: Bool): Some[Boolean] = Some(bool.value)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions