Skip to content

Fail on the non-exhausted oneOf schema #16

@semenodm

Description

@semenodm

Maybe we can find a way to fail on compilation if user provided non-exhaustive ADT legs

sealed trait Foo
case class A extends Foo
case class B extends Foo
case class C extends Foo

val schema : Schema[Foo] = Schema.oneOf[Foo]{alt =>
val schemaA : Schema[A] = ???
val schemaB : Schema[B] = ???

alt(schemaA) |+| alt(schemaB) // fail to compile here, because missing schemaC
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions