Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Generate simpler top-level value bindings for p4_value.

Previously, a `type t = int` would generate:
```
let (value_of_t : ?id_seed: (Int64.t ref) -> t -> Dyntype.Value.t) =
```

Now, we generate the simpler:
```
let value_of_t = <...>
```

This is because type_conv-108.07.00 attempts to parse the toplevel
bindings and generate dummy references to suppress the OCaml4
'unused variable' warning.  This generation is buggy, and does not
differentiate between value bindings and the type hints.
  • Loading branch information...
commit 3569269c8cad3f013151fb1b5d89cf76981f1df1 1 parent 1b6ab38
@avsm avsm authored
Showing with 2 additions and 6 deletions.
  1. +2 −6 pa_lib/p4_value.ml
View
8 pa_lib/p4_value.ml
@@ -204,11 +204,7 @@ module Value_of = struct
biAnd_of_list bindings
let inputs _loc ~id_seed_t ~opt ids =
- let value_of_fn x =
- if opt then
- <:patt< ($lid:value_of x$ : ?id_seed:$id_seed_t$ -> $lid:x$ -> Dyntype.Value.t) >>
- else
- <:patt< ($lid:value_of x$ : ~id_seed:$id_seed_t$ -> $lid:x$ -> Dyntype.Value.t) >> in
+ let value_of_fn x = <:patt< $lid:value_of x$ >> in
let value_of_fns = List.map value_of_fn ids in
patt_tuple_of_list _loc value_of_fns
@@ -408,7 +404,7 @@ module Of_value = struct
biAnd_of_list bindings
let inputs _loc ids =
- let of_value_fns = List.map (fun x -> <:patt< ($lid:of_value x$ : Dyntype.Value.t -> $lid:x$) >>) ids in
+ let of_value_fns = List.map (fun x -> <:patt< $lid:of_value x$ >>) ids in
patt_tuple_of_list _loc of_value_fns
let outputs _loc ids =
Please sign in to comment.
Something went wrong with that request. Please try again.