Skip to content

Commit

Permalink
Fix incorrect type information in DataTypes.ml
Browse files Browse the repository at this point in the history
  • Loading branch information
msprotz committed Nov 27, 2023
1 parent b09427b commit 419718c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/DataTypes.ml
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ let compile_simple_matches (map, enums) = object(self)
| ToFlat names ->
PRecord (List.map2 (fun n e -> n, self#visit_pattern_w () e) names args)
| ToFlatTaggedUnion branches ->
let t_tag = mk_tag_lid lid cons in
let t_tag = TQualified (self#allocate_enum_lid lid branches) in
let fields =
if List.length args = 0 then
[]
Expand All @@ -437,7 +437,7 @@ let compile_simple_matches (map, enums) = object(self)
List.map2 (fun (f, _) e -> f, self#visit_pattern_w () e) fields args
in
PRecord ([
field_for_tag, with_type (TQualified t_tag) (PEnum (mk_tag_lid lid cons))
field_for_tag, with_type t_tag (PEnum (mk_tag_lid lid cons))
] @ fields)

method private allocate_enum_lid lid branches =
Expand Down
3 changes: 2 additions & 1 deletion lib/PrintAst.ml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ and print_let_binding (binder, e1) =
jump (print_expr e1))

and print_expr { node; typ } =
print_typ typ ^^ colon ^^ space ^^
(* print_typ typ ^^ colon ^^ space ^^ *)
match node with
| EComment (s, e, s') ->
surround 2 1 (string s) (print_expr e) (string s')
Expand Down Expand Up @@ -345,6 +345,7 @@ and print_branch (binders, pat, expr) =
) ^/^ jump ~indent:4 (print_expr expr)

and print_pat p =
(* print_typ p.typ ^^ colon ^^ space ^^ *)
match p.node with
| PWild ->
string "_"
Expand Down

0 comments on commit 419718c

Please sign in to comment.