Skip to content

Commit c3e84be

Browse files
mshinwelllthls
authored andcommitted
Fix for expand_head on aliases of Phantom name mode
1 parent 5e11d5c commit c3e84be

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

middle_end/flambda2.0/types/type_descr.rec.ml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,16 +150,13 @@ module Make (Head : Type_head_intf.S
150150
| Type _export_id -> Misc.fatal_error ".cmx loading not yet implemented"
151151
| Equals simple ->
152152
let min_name_mode = Name_mode.min_in_types in
153-
(* We must get the canonical simple with the least occurrence kind,
154-
since that's the one that is guaranteed not to have an [Equals]
155-
type. *)
156153
match TE.get_canonical_simple env simple ~min_name_mode with
157154
| Bottom -> Bottom
158155
| Ok None ->
159-
Misc.fatal_errorf "There should always be a canonical simple for %a \
160-
in environment:@ %a"
161-
Simple.print simple
162-
TE.print env
156+
(* This can happen when [simple] is of [Phantom] name mode.
157+
We're not interested in propagating types for phantom variables,
158+
so [Unknown] is fine here. *)
159+
Unknown
163160
| Ok (Some simple) ->
164161
match Simple.descr simple with
165162
| Const const ->

0 commit comments

Comments
 (0)