summaryrefslogtreecommitdiff
path: root/src/InterpreterPaths.ml
diff options
context:
space:
mode:
authorSon Ho2022-01-18 22:43:52 +0100
committerSon Ho2022-01-18 22:43:52 +0100
commit280c5b1a7fde56d1d0238b44555de486fc1f563e (patch)
tree7418c9ea9fb1d06bc6dc5a0547c770032719a3ab /src/InterpreterPaths.ml
parent90d47b033118c923591f7a64d63a98709ce7aa4b (diff)
Update type_context to have to have a type info field, use maps instead
of lists to store the types/functions definitions
Diffstat (limited to '')
-rw-r--r--src/InterpreterPaths.ml4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/InterpreterPaths.ml b/src/InterpreterPaths.ml
index 4482a507..cf02fc23 100644
--- a/src/InterpreterPaths.ml
+++ b/src/InterpreterPaths.ml
@@ -346,14 +346,14 @@ let write_place_unwrap (config : C.config) (access : access_kind) (p : E.place)
| Ok ctx -> ctx
(** Compute an expanded ADT bottom value *)
-let compute_expanded_bottom_adt_value (tyctx : T.type_def list)
+let compute_expanded_bottom_adt_value (tyctx : T.type_def T.TypeDefId.Map.t)
(def_id : T.TypeDefId.id) (opt_variant_id : T.VariantId.id option)
(regions : T.erased_region list) (types : T.ety list) : V.typed_value =
(* Lookup the definition and check if it is an enumeration - it
should be an enumeration if and only if the projection element
is a field projection with *some* variant id. Retrieve the list
of fields at the same time. *)
- let def = T.TypeDefId.nth tyctx def_id in
+ let def = T.TypeDefId.Map.find def_id tyctx in
assert (List.length regions = List.length def.T.region_params);
(* Compute the field types *)
let field_types =