type none_type = None
type t = { foo: int } [@@deriving sexp]
Gives a confusing error:
3 | type t = { foo: int } [@@deriving sexp]
^^^
Error: This variant pattern is expected to have type none_type
The constructor Some does not belong to type none_type
Had errors, waiting for filesystem changes...
This is because the generated code uses None assuming it is a constructor for option. Editing the generated code to have let foo_field = ref Stdlib.Option.None instead of let foo_field = ref None fixes things. Could this be changed in the ppx? Happy to write a PR.
Example:
Gives a confusing error:
This is because the generated code uses
None
assuming it is a constructor foroption
. Editing the generated code to havelet foo_field = ref Stdlib.Option.None
instead oflet foo_field = ref None
fixes things. Could this be changed in the ppx? Happy to write a PR.