Skip to content

Commit 59763a1

Browse files
authored
[Super errors] No need for fallback location printing (#2719)
See updated comment. Test plan: this path is never reached for normal files. Try this in e.g. the playground where file is actually "". See no more double location reporting.
1 parent f44fd74 commit 59763a1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

jscomp/super_errors/super_location.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,9 @@ let print ~is_warning intro ppf loc =
106106
(Super_misc.print_file ~is_warning ~lines ~range)
107107
()
108108
with
109-
(* this shouldn't happen, but gracefully fall back to the default reporter just in case *)
110-
| Sys_error _ -> Location.print ppf loc
109+
(* this might happen if the file is e.g. "", "_none_" or any of the fake file name placeholders.
110+
we've already printed the location above, so nothing more to do here. *)
111+
| Sys_error _ -> ()
111112
end
112113
;;
113114

0 commit comments

Comments
 (0)