Skip to content

Commit

Permalink
Only display the "missing rec" hint for non-ghost code
Browse files Browse the repository at this point in the history
  • Loading branch information
Armaël Guéneau committed Apr 23, 2018
1 parent dc6bada commit 1e0e6f0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions typing/typecore.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2826,9 +2826,15 @@ and type_expect_
| Val_unbound Val_unbound_instance_variable ->
raise(Error(loc, env, Masked_instance_variable lid.txt))
| Val_unbound Val_unbound_ghost_recursive ->
raise(Typetexp.Error(
loc, env, Typetexp.Unbound_value_missing_rec (lid.txt, desc.val_loc)
))
(* Only display the "missing rec" hint for non-ghost code *)
if not loc.Location.loc_ghost
&& not desc.val_loc.Location.loc_ghost
then
raise Typetexp.(Error (
loc, env, Unbound_value_missing_rec (lid.txt, desc.val_loc)
))
else
raise Typetexp.(Error (loc, env, Unbound_value lid.txt))
(*| Val_prim _ ->
let p = Env.normalize_path (Some loc) env path in
Env.add_required_global (Path.head p);
Expand Down

0 comments on commit 1e0e6f0

Please sign in to comment.