Skip to content

Commit

Permalink
error for wildcard
Browse files Browse the repository at this point in the history
  • Loading branch information
benbellick committed Dec 17, 2024
1 parent 9946073 commit fb529c4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/decoders_deriver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ let rec expr_of_typ (typ : core_type)
"Cannot construct decoder for %s: cannot decode explicitly polymorphic \
types"
(string_of_core_type typ)
| { ptyp_desc = Ptyp_any; _ } ->
Location.raise_errorf ~loc
"Cannot construct decoder for %s: cannot decode wildcard in type "
(string_of_core_type typ)
| _ ->
Location.raise_errorf ~loc "Cannot construct decoder for %s"
(string_of_core_type typ)
Expand Down
4 changes: 4 additions & 0 deletions src/encoders_deriver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ let rec expr_of_typ (typ : core_type) : expression =
"Cannot construct encoder for %s: cannot encode explicitly polymorphic \
types"
(string_of_core_type typ)
| { ptyp_desc = Ptyp_any _; _ } ->
Location.raise_errorf ~loc
"Cannot construct encoder for %s: cannot encode wildcard in type "
(string_of_core_type typ)
| _ ->
Location.raise_errorf ~loc "Cannot construct encoder for %s"
(string_of_core_type typ)
Expand Down

0 comments on commit fb529c4

Please sign in to comment.