@@ -755,24 +755,17 @@ let transl_declaration env sdecl (id, uid) =
755
755
let jkind =
756
756
(* - If there's an annotation, we use that. It's checked against
757
757
a kind in [update_decl_jkind] and the manifest in [check_coherence].
758
- - If there's no annotation but there is a manifest, we estimate the
759
- jkind based on the manifest here. This upper bound saves time
760
- later by avoiding expanding the manifest in jkind checks, but it
761
- would be sound to leave in `any`. We can't give a perfectly
762
- accurate jkind here because we don't have access to the
763
- manifests of mutually defined types (but we could one day consider
764
- improving it at a later point in transl_type_decl).
758
+ Both of those functions update the [type_jkind] field in the
759
+ [type_declaration] as appropriate.
760
+ - If there's no annotation but there is a manifest, just use [any].
761
+ This will get updated to the manifest's jkind in [check_coherence].
765
762
- If there's no annotation and no manifest, we fill in with the
766
763
default calculated above here. It will get updated in
767
764
[update_decl_jkind]. See Note [Default jkinds in transl_declaration].
768
765
*)
769
- (* CR layouts: Is the estimation mentioned in the second bullet above
770
- doing anything for us? Abstract types are updated by
771
- check_coherence and record/variant types are updated by
772
- update_decl_jkind. *)
773
766
match jkind_annotation, man with
774
767
| Some annot , _ -> annot
775
- | None , Some typ -> Ctype. estimate_type_jkind env typ
768
+ | None , Some _ -> Jkind. any ~why: Initial_typedecl_env
776
769
| None , None -> jkind_default
777
770
in
778
771
let arity = List. length params in
@@ -1777,10 +1770,10 @@ let transl_type_decl env rec_flag sdecl_list =
1777
1770
| Typedecl_separability. Error (loc , err ) ->
1778
1771
raise (Error (loc, Separability err))
1779
1772
in
1773
+ (* Check re-exportation, updating [type_jkind] from the manifest *)
1774
+ let decls = List. map2 (check_abbrev new_env) sdecl_list decls in
1780
1775
(* Compute the final environment with variance and immediacy *)
1781
1776
let final_env = add_types_to_env decls env in
1782
- (* Check re-exportation *)
1783
- let decls = List. map2 (check_abbrev final_env) sdecl_list decls in
1784
1777
(* Keep original declaration *)
1785
1778
let final_decls =
1786
1779
List. map2
0 commit comments