Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support 4.12 #107

Merged
merged 14 commits into from
Oct 21, 2020
Prev Previous commit
Next Next commit
add injectivity type
Signed-off-by: Carl Eastlund <[email protected]>
  • Loading branch information
ceastlund committed Oct 19, 2020
commit 55e58f8df8736ef3649ef81cb8a884b72aa3dece
13 changes: 8 additions & 5 deletions src/ast_412.ml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,14 @@ module Asttypes = struct
loc : Location.t;
}


type variance (*IF_CURRENT = Asttypes.variance *) =
| Covariant
| Contravariant
| Invariant
| NoVariance

type injectivity (*IF_CURRENT = Asttypes.injectivity *) =
| Injective
| NoInjectivity
end

module Parsetree = struct
Expand Down Expand Up @@ -471,7 +474,7 @@ module Parsetree = struct
and type_declaration (*IF_CURRENT = Parsetree.type_declaration *) =
{
ptype_name: string loc;
ptype_params: (core_type * variance) list;
ptype_params: (core_type * (variance * injectivity)) list;
(* ('a1,...'an) t; None represents _*)
ptype_cstrs: (core_type * core_type * Location.t) list;
(* ... constraint T1=T1' ... constraint Tn=Tn' *)
Expand Down Expand Up @@ -539,7 +542,7 @@ module Parsetree = struct
and type_extension (*IF_CURRENT = Parsetree.type_extension *) =
{
ptyext_path: Longident.t loc;
ptyext_params: (core_type * variance) list;
ptyext_params: (core_type * (variance * injectivity)) list;
ptyext_constructors: extension_constructor list;
ptyext_private: private_flag;
ptyext_loc: Location.t;
Expand Down Expand Up @@ -640,7 +643,7 @@ module Parsetree = struct
and 'a class_infos (*IF_CURRENT = 'a Parsetree.class_infos *) =
{
pci_virt: virtual_flag;
pci_params: (core_type * variance) list;
pci_params: (core_type * (variance * injectivity)) list;
pci_name: string loc;
pci_expr: 'a;
pci_loc: Location.t;
Expand Down