Skip to content

Commit 6c6cf93

Browse files
committed
Debug
1 parent d47de8e commit 6c6cf93

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

src/ocaml/typing/env.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2393,9 +2393,9 @@ let enter_value ?check name desc env =
23932393
let env = store_value ?check id addr desc (Shape.leaf desc.val_uid) env in
23942394
(id, env)
23952395

2396-
let enter_type ~scope name info env =
2396+
let enter_type ?(long_path = false) ~scope name info env =
23972397
let id = Ident.create_scoped ~scope name in
2398-
let env = store_type ~check:true ~predef:false ~long_path:false
2398+
let env = store_type ~check:true ~predef:false ~long_path
23992399
id info (Shape.leaf info.type_uid) env
24002400
in
24012401
(id, env)

src/ocaml/typing/env.mli

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,9 @@ val remove_last_open: Path.t -> t -> t option
359359
val enter_value:
360360
?check:(string -> Warnings.t) ->
361361
string -> value_description -> t -> Ident.t * t
362-
val enter_type: scope:int -> string -> type_declaration -> t -> Ident.t * t
362+
val enter_type:
363+
?long_path:bool -> scope:int ->
364+
string -> type_declaration -> t -> Ident.t * t
363365
val enter_extension:
364366
scope:int -> rebind:bool -> string ->
365367
extension_constructor -> t -> Ident.t * t

src/ocaml/typing/typecore.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,8 @@ let solve_constructor_annotation
913913
new_local_type ~loc:name.loc Definition
914914
~manifest_and_scope:(tv, Ident.lowest_scope) in
915915
let (id, new_env) =
916-
Env.enter_type ~scope:expansion_scope name.txt decl !!penv in
916+
(* These redundant types should not be added to the shortpath graph *)
917+
Env.enter_type ~long_path:true ~scope:expansion_scope name.txt decl !!penv in
917918
Pattern_env.set_env penv new_env;
918919
({name with txt = id}, (decl, tv)))
919920
name_list
@@ -951,7 +952,7 @@ let solve_constructor_annotation
951952
Tconstr(Path.Pident id, [], _) when List.mem_assoc id rem ->
952953
let decl, tv' = List.assoc id ids_decls in
953954
let env =
954-
Env.add_type_long_path ~check:false id
955+
Env.add_type ~check:false id
955956
{decl with type_manifest = None} !!penv
956957
in
957958
Pattern_env.set_env penv env;
@@ -987,8 +988,7 @@ let solve_constructor_annotation
987988
(Bind_non_locally_abstract, id, tv')));
988989
end;
989990
let env =
990-
(* These redundant types should not be added to the shortpath graph *)
991-
Env.add_type_long_path ~check:false id
991+
Env.add_type ~check:false id
992992
{decl with type_manifest = Some (duplicate_type tv')} !!penv
993993
in
994994
Pattern_env.set_env penv env)

0 commit comments

Comments
 (0)