Skip to content

Exhaustive check during pattern matching on Coproduct #103

Open
@a-nigredo

Description

@a-nigredo

It would be nice to have compilation error if there is a pattern matching on not all injected values.
e.g.

type Primitive = Cop[String :: Boolean :: TNil
object Primitive {
  val Str= Cop.Inject[String, Primitive]
  val Bool= Cop.Inject[Boolean, Primitive]
}
def print(v: Primitive) =
  v match {
    case Str(v) => println(v)
  }

should throw compilation error since there is not Bool case

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions