diff options
Diffstat (limited to 'src/Substitute.ml')
-rw-r--r-- | src/Substitute.ml | 10 |
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 *) |