-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
make the optional row_fixed_path argument more explicit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -496,8 +496,9 @@ let merge_constraint initial_env remove_aliases loc sg constr = | |
let initial_env = | ||
Env.add_type ~check:false id_row decl_row initial_env | ||
in | ||
let tdecl = Typedecl.transl_with_constraint | ||
initial_env id (Some(Pident id_row)) decl sdecl in | ||
let tdecl = | ||
Typedecl.transl_with_constraint | ||
initial_env id ~fixed_row_path:(Pident id_row) decl sdecl in | ||
let newdecl = tdecl.typ_type in | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
garrigue
Contributor
|
||
check_type_decl env sdecl.ptype_loc id row_id newdecl decl rs rem; | ||
let decl_row = {decl_row with type_params = newdecl.type_params} in | ||
|
@@ -509,7 +510,7 @@ let merge_constraint initial_env remove_aliases loc sg constr = | |
| (Sig_type(id, decl, rs, priv) :: rem , [s], Pwith_type (_, sdecl)) | ||
when Ident.name id = s -> | ||
let tdecl = | ||
Typedecl.transl_with_constraint initial_env id None decl sdecl in | ||
Typedecl.transl_with_constraint initial_env id decl sdecl in | ||
let newdecl = tdecl.typ_type in | ||
check_type_decl env sdecl.ptype_loc id row_id newdecl decl rs rem; | ||
(Pident id, lid, Twith_type tdecl), | ||
|
@@ -521,7 +522,7 @@ let merge_constraint initial_env remove_aliases loc sg constr = | |
when Ident.name id = s -> | ||
(* Check as for a normal with constraint, but discard definition *) | ||
let tdecl = | ||
Typedecl.transl_with_constraint initial_env id None decl sdecl in | ||
Typedecl.transl_with_constraint initial_env id decl sdecl in | ||
let newdecl = tdecl.typ_type in | ||
check_type_decl env sdecl.ptype_loc id row_id newdecl decl rs rem; | ||
real_ids := [Pident id]; | ||
|
Naive question, probably for @trefis or @garrigue: instead of passing ~fixed_row_path:(Pident id_row) here, why can't we just call
set_fixed_row env tdecl.type_loc newdecl (Pident id_row)
here? (I suppose that some of the stuff that happens intransl_with_constraint
may interact with theset_fixed_row
call?)