Skip to content

Commit

Permalink
[typer] treat empty anons as open structure constraints
Browse files Browse the repository at this point in the history
see #9593
  • Loading branch information
Simn committed Jun 16, 2020
1 parent 3ef7a20 commit 5358840
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/tUnification.ml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ module Monomorph = struct
PMap.fold (fun cf l ->
(MField cf) :: l
) an.a_fields []
| TAnon _ ->
[MOpenStructure]
| _ ->
[MType(t,name)]

Expand Down Expand Up @@ -96,7 +98,7 @@ module Monomorph = struct
List.iter check m.tm_constraints;
if DynArray.length types > 0 then
CTypes (DynArray.to_list types)
else if not (PMap.is_empty !fields) then
else if not (PMap.is_empty !fields) || !is_open then
CStructural(!fields,!is_open)
else
CUnknown
Expand Down

0 comments on commit 5358840

Please sign in to comment.