Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 26 additions & 9 deletions jscomp/super_errors/super_typetexp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,33 @@ let report_error env ppf = function
spellcheck ppf Env.fold_values env lid;
| Unbound_module lid ->
(* modified *)
fprintf ppf "@[<v>\
@{<info>The module or file %a can't be found.@}@,@,\
@[<v 2>- If it's a third-party dependency:@,\
- Did you list it in bsconfig.json?@,\
- @[Did you run `bsb` instead of `bsb -make-world`@ (latter builds third-parties)@]?\
@]@,\
- Did you include the file's directory in bsconfig.json?@]\
@]"
longident lid;
begin match lid with
| Lident "Str" ->
begin
fprintf ppf "@[\
@{<info>The module or file %a can't be found.@}@,@,\
Are you trying to use the standard library's Str?@ \
If you're compiling to JavaScript,@ use @{<info>Js.Re@} instead.@ \
Otherwise, add str.cma to your ocamlc/ocamlopt command.\
@]"
longident lid
end
| lid ->
begin
fprintf ppf "@[<v>\
@{<info>The module or file %a can't be found.@}@,\
@[<v 2>- If it's a third-party dependency:@,\
- Did you list it in bsconfig.json?@,\
- @[Did you run `bsb` instead of `bsb -make-world`@ (latter builds third-parties)@]?\
@]@,\
- Did you include the file's directory in bsconfig.json?@]\
@]"
longident lid
end
end;
spellcheck ppf Env.fold_modules env lid
| Unbound_constructor lid ->
(* modified *)
fprintf ppf "@[<v>\
@{<info>The variant constructor %a can't be found.@}@,@,\
@[<v 2>- If it's defined in another module or file, bring it into scope by:@,\
Expand All @@ -162,6 +178,7 @@ let report_error env ppf = function
Typetexp.spellcheck_simple ppf Env.fold_constructors (fun d -> d.cstr_name)
env lid;
| Unbound_label lid ->
(* modified *)
fprintf ppf "@[<v>\
@{<info>The record field %a can't be found.@}@,@,\
If it's defined in another module or file, bring it into scope by:@,\
Expand Down