|
@@ -80,7 +80,6 @@ module Monomorph = struct
|
|
let types = DynArray.create () in
|
|
let types = DynArray.create () in
|
|
let fields = ref PMap.empty in
|
|
let fields = ref PMap.empty in
|
|
let is_open = ref false in
|
|
let is_open = ref false in
|
|
- let is_empty = ref false in
|
|
|
|
let rec check constr = match constr with
|
|
let rec check constr = match constr with
|
|
| MMono(m2,name) ->
|
|
| MMono(m2,name) ->
|
|
begin match m2.tm_type with
|
|
begin match m2.tm_type with
|
|
@@ -93,18 +92,15 @@ module Monomorph = struct
|
|
fields := PMap.add cf.cf_name cf !fields;
|
|
fields := PMap.add cf.cf_name cf !fields;
|
|
| MType(t2,name) ->
|
|
| MType(t2,name) ->
|
|
DynArray.add types (t2,name)
|
|
DynArray.add types (t2,name)
|
|
- | MOpenStructure ->
|
|
|
|
- is_open := true
|
|
|
|
|
|
+ | MOpenStructure
|
|
| MEmptyStructure ->
|
|
| MEmptyStructure ->
|
|
- is_empty := true;
|
|
|
|
|
|
+ is_open := true
|
|
in
|
|
in
|
|
List.iter check m.tm_constraints;
|
|
List.iter check m.tm_constraints;
|
|
if DynArray.length types > 0 then
|
|
if DynArray.length types > 0 then
|
|
CTypes (DynArray.to_list types)
|
|
CTypes (DynArray.to_list types)
|
|
else if not (PMap.is_empty !fields) || !is_open then
|
|
else if not (PMap.is_empty !fields) || !is_open then
|
|
CStructural(!fields,!is_open)
|
|
CStructural(!fields,!is_open)
|
|
- else if !is_empty then
|
|
|
|
- CStructural(PMap.empty,true)
|
|
|
|
else
|
|
else
|
|
CUnknown
|
|
CUnknown
|
|
|
|
|