Skip to content

Commit

Permalink
Fix types merge
Browse files Browse the repository at this point in the history
  • Loading branch information
ccasin committed Nov 13, 2023
1 parent c3501de commit 04166f3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/ocaml/typing/types.ml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ module Variance = struct
let mp =
mem May_pos v1 && mem May_pos v2 || mem May_neg v1 && mem May_neg v2
and mn =
mem May_pos v1 && mem May_neg v2 || mem May_pos v1 && mem May_neg v2
mem May_pos v1 && mem May_neg v2 || mem May_neg v1 && mem May_pos v2
and mw = mem May_weak v1 && v2 <> null || v1 <> null && mem May_weak v2
and inj = mem Inj v1 && mem Inj v2
and pos = mem Pos v1 && mem Pos v2 || mem Neg v1 && mem Neg v2
Expand Down Expand Up @@ -607,6 +607,15 @@ let find_unboxed_type decl =
| Type_abstract _ | Type_open ->
None

let item_visibility = function
| Sig_value (_, _, vis)
| Sig_type (_, _, _, vis)
| Sig_typext (_, _, _, vis)
| Sig_module (_, _, _, _, vis)
| Sig_modtype (_, _, vis)
| Sig_class (_, _, _, vis)
| Sig_class_type (_, _, _, vis) -> vis

type label_description =
{ lbl_name: string; (* Short name *)
lbl_res: type_expr; (* Type of the result *)
Expand Down
2 changes: 2 additions & 0 deletions src/ocaml/typing/types.mli
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,8 @@ end

include Wrapped with type 'a wrapped = 'a

val item_visibility : signature_item -> visibility

(* Constructor and record label descriptions inserted held in typing
environments *)

Expand Down

0 comments on commit 04166f3

Please sign in to comment.