diff options
author | Son Ho | 2023-08-01 11:16:06 +0200 |
---|---|---|
committer | Son Ho | 2023-08-01 11:16:06 +0200 |
commit | 50af296306bfee9f0b127dde8abe5fb0ec1b0acb (patch) | |
tree | 1c431c189dba0cf47093a8be87b05a036512eaf6 /compiler/Assumed.ml | |
parent | 887d0ef1efc8912c6273b5ebcf979384e9d7fa97 (diff) |
Start adding support for const generics
Diffstat (limited to '')
-rw-r--r-- | compiler/Assumed.ml | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler/Assumed.ml b/compiler/Assumed.ml index e751d0ba..2fbb9044 100644 --- a/compiler/Assumed.ml +++ b/compiler/Assumed.ml @@ -53,6 +53,8 @@ module Sig = struct (** Type parameter [T] of id 0 *) let type_param_0 : T.type_var = { T.index = tvar_id_0; name = "T" } + let empty_const_generic_params : T.const_generic_var list = [] + let mk_ref_ty (r : T.RegionVarId.id T.region) (ty : T.sty) (is_mut : bool) : T.sty = let ref_kind = if is_mut then T.Mut else T.Shared in @@ -73,6 +75,7 @@ module Sig = struct num_early_bound_regions = 0; regions_hierarchy; type_params; + const_generic_params = empty_const_generic_params; inputs; output; } @@ -84,6 +87,7 @@ module Sig = struct num_early_bound_regions = 0; regions_hierarchy = []; type_params = [ type_param_0 ] (* <T> *); + const_generic_params = empty_const_generic_params; inputs = [ tvar_0 (* T *) ]; output = mk_box_ty tvar_0 (* Box<T> *); } @@ -95,6 +99,7 @@ module Sig = struct num_early_bound_regions = 0; regions_hierarchy = []; type_params = [ type_param_0 ] (* <T> *); + const_generic_params = empty_const_generic_params; inputs = [ mk_box_ty tvar_0 (* Box<T> *) ]; output = mk_unit_ty (* () *); } @@ -112,6 +117,7 @@ module Sig = struct num_early_bound_regions = 0; regions_hierarchy; type_params = [ type_param_0 ] (* <T> *); + const_generic_params = empty_const_generic_params; inputs = [ mk_ref_ty rvar_0 (mk_box_ty tvar_0) is_mut (* &'a (mut) Box<T> *) ]; output = mk_ref_ty rvar_0 tvar_0 is_mut (* &'a (mut) T *); @@ -135,6 +141,7 @@ module Sig = struct num_early_bound_regions = 0; regions_hierarchy; type_params; + const_generic_params = empty_const_generic_params; inputs; output; } @@ -157,6 +164,7 @@ module Sig = struct num_early_bound_regions = 0; regions_hierarchy; type_params; + const_generic_params = empty_const_generic_params; inputs; output; } @@ -180,6 +188,7 @@ module Sig = struct num_early_bound_regions = 0; regions_hierarchy; type_params; + const_generic_params = empty_const_generic_params; inputs; output; } @@ -199,6 +208,7 @@ module Sig = struct num_early_bound_regions = 0; regions_hierarchy; type_params; + const_generic_params = empty_const_generic_params; inputs; output; } @@ -223,6 +233,7 @@ module Sig = struct num_early_bound_regions = 0; regions_hierarchy; type_params; + const_generic_params = empty_const_generic_params; inputs; output; } |