summaryrefslogtreecommitdiff
path: root/src/Substitute.ml
diff options
context:
space:
mode:
authorSon Ho2022-02-08 13:58:57 +0100
committerSon Ho2022-02-08 13:58:57 +0100
commitc80141a9874345b71ee5e6c37947e1f0825698a7 (patch)
treea1ae43a474169d0b01cbdb8fa1187db2e17ccc81 /src/Substitute.ml
parent33261269a5264b416a0d8d87b9622345c40f2895 (diff)
Start adding more assumed types and functions
Diffstat (limited to '')
-rw-r--r--src/Substitute.ml10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Substitute.ml b/src/Substitute.ml
index 01ce3a4e..62822785 100644
--- a/src/Substitute.ml
+++ b/src/Substitute.ml
@@ -168,10 +168,16 @@ let ctx_adt_value_get_instantiated_field_rtypes (ctx : C.eval_ctx)
type_params
| T.Assumed aty -> (
match aty with
- | T.Box ->
+ | T.Box | T.Vec ->
assert (List.length region_params = 0);
assert (List.length type_params = 1);
- type_params)
+ type_params
+ | T.Option ->
+ assert (List.length region_params = 0);
+ assert (List.length type_params = 1);
+ if adt.V.variant_id = Some T.option_some_id then type_params
+ else if adt.V.variant_id = Some T.option_none_id then []
+ else failwith "Unrechable")
(** Instantiate the type variables in an ADT definition, and return the list
of types of the fields for the chosen variant *)