Skip to content

Commit

Permalink
In substitutions, lazyly refresh the codomain of the univar map
Browse files Browse the repository at this point in the history
This map is allowed to do name capture and is hence sensitive
to bound variables renaming.
  • Loading branch information
strub committed Dec 5, 2023
1 parent dd02a37 commit 7c0adea
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/ecTypes.ml
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,15 @@ let rec ty_subst s =
| Some ty -> ty_subst s ty
end
end
| Tunivar id -> Muid.find_def ty id s.ts_u
| Tvar id -> Mid.find_def ty id s.ts_v
| Tunivar id -> begin
match Muid.find_opt id s.ts_u with
| None ->
ty
| Some ty ->
ty_subst s ty
end

| Tvar id -> Mid.find_def ty id s.ts_v
| _ -> ty_map (ty_subst s) ty

(* -------------------------------------------------------------------- *)
Expand Down

0 comments on commit 7c0adea

Please sign in to comment.