Skip to content

Produces a warning on uninhabitable sum type constructors #168

@Negabinary

Description

@Negabinary

Here's an example in ReasonML:

open Ppx_yojson_conv_lib.Yojson_conv;

[@deriving yojson]
type empty =
  |;

[@deriving yojson]
type t =
  | A(int)
  | B(empty);

When I try to create a type with an uninhabitable case, the derived code causes the compiler to emit warning 56 : unreachable pattern. I also can't work out if there's a way to disable warning 56 on just the generate code here.

(I'm also seeing this on the sexp deriver janestreet/ppx_sexp_conv#44)

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