File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -326,11 +326,13 @@ module Compile = struct
326326 Buffer. reset warning_buffer;
327327 str
328328
329- let super_warning_printer loc ppf w =
329+ (* We need to overload the original warning printer to capture the warnings
330+ as an array *)
331+ let playground_warning_printer loc ppf w =
330332 match Warnings. report w with
331333 | `Inactive -> ()
332334 | `Active { Warnings. number; is_error; } ->
333- ! Location. warning_printer loc ppf w;
335+ Location. default_warning_printer loc ppf w;
334336 let open LocWarnInfo in
335337 let fullMsg = flush_warning_buffer () in
336338 let shortMsg = Warnings. message w in
@@ -345,7 +347,7 @@ module Compile = struct
345347
346348 let () =
347349 Location. formatter_for_warnings := warning_ppf;
348- Location. warning_printer := super_warning_printer
350+ Location. warning_printer := playground_warning_printer
349351
350352 let handle_err e =
351353 (match error_of_exn e with
You can’t perform that action at this time.
0 commit comments