summaryrefslogtreecommitdiff
path: root/src/Substitute.ml
diff options
context:
space:
mode:
Diffstat (limited to 'src/Substitute.ml')
-rw-r--r--src/Substitute.ml4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Substitute.ml b/src/Substitute.ml
index ad896c41..13e0b583 100644
--- a/src/Substitute.ml
+++ b/src/Substitute.ml
@@ -34,6 +34,10 @@ let rec ty_substitute (rsubst : 'r1 -> 'r2)
| Str -> Str
| TypeVar vid -> tsubst vid
+(** Convert an [rty] to an [ety] by erasing the region variables *)
+let erase_regions (ty : T.rty) : T.ety =
+ ty_substitute (fun _ -> T.Erased) (fun vid -> T.TypeVar vid) ty
+
(** Erase the regions in a type and substitute the type variables *)
let erase_regions_substitute_types (tsubst : T.TypeVarId.id -> T.ety)
(ty : T.rty) : T.ety =