Skip to content

Commit

Permalink
Fix depth variables escaping in return types (ocaml-flambda#1656)
Browse files Browse the repository at this point in the history
  • Loading branch information
lthls authored Aug 4, 2023
1 parent cfe718b commit b3903fa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion middle_end/flambda2/types/grammar/type_descr.ml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,13 @@ end = struct
| Equals simple ->
Simple.pattern_match' simple
~const:(fun _ -> Not_expanded t)
~symbol:(fun _ ~coercion:_ -> Not_expanded t)
~symbol:(fun symbol ~coercion ->
if Coercion.is_id coercion
then Not_expanded t
else
(* Coercions might contain variables. Removing any coercion
happens to fix all potential problems. *)
Not_expanded (Equals (Simple.symbol symbol)))
~var:(fun var ~coercion ->
if Variable.Set.mem var to_project
then Expanded (expand var ~coercion)
Expand Down

0 comments on commit b3903fa

Please sign in to comment.