File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed
Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -1393,21 +1393,20 @@ let print_version_num () =
13931393module Test = struct
13941394 let map_loc f {Location. loc;txt} = {Location. loc; txt= f txt}
13951395
1396+ let shorten_warning_name s =
1397+ Scanf. sscanf s " %d" string_of_int
1398+
13961399 let shorten_kind = function
1397- | Location. Report_error -> Location. Report_error
1398- | Report_warning _ -> Report_warning " A"
1399- | Report_warning_as_error _ -> Report_warning_as_error " B"
1400- | Report_alert _ -> Report_alert " C"
1401- | Report_alert_as_error _ -> Report_alert " D"
1400+ | Location. Report_warning s -> Location. Report_warning (shorten_warning_name s)
1401+ | k -> k
14021402
14031403 let short_warning_reporter loc warn =
14041404 Option. map
1405- (fun report ->
1406- { report with Location. main = Location. mknoloc (fun _ -> () )
1407- ; kind = shorten_kind report.Location. kind
1408- }
1409- )
1410- (Location. default_warning_reporter loc warn)
1405+ (fun report ->
1406+ { report with
1407+ Location. kind = shorten_kind report.Location. kind }
1408+ )
1409+ (Location. default_warning_reporter loc warn)
14111410
14121411 let short_report_printer () =
14131412 let def = Location. batch_mode_printer in
@@ -1417,6 +1416,7 @@ module Test = struct
14171416 { def with pp }
14181417
14191418 let setup () =
1419+ Location. warning_reporter := short_warning_reporter;
14201420 Location. report_printer := short_report_printer
14211421
14221422 let run path =
Original file line number Diff line number Diff line change 11# type t = () of unit;;
2- Warning 65 [redefining-unit]
2+ Warning 65
33type t = () of unit
44# 0;;
55Error
You can’t perform that action at this time.
0 commit comments