File tree Expand file tree Collapse file tree 4 files changed +19
-3
lines changed
tests/build_tests/super_errors Expand file tree Collapse file tree 4 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 3737- Rewatch: Add --dev flag to clean command. https://github.com/rescript-lang/rescript/pull/7622
3838- Rewatch: Use root package suffix in clean log messages. https://github.com/rescript-lang/rescript/pull/7648
3939- Fix inside comment printing for empty dict. https://github.com/rescript-lang/rescript/pull/7654
40+ - Fix I/O error message when trying to extract extra info from non-existing file. https://github.com/rescript-lang/rescript/pull/7656
4041
4142# 12.0.0-beta.1
4243
Original file line number Diff line number Diff line change @@ -41,9 +41,13 @@ end = struct
4141 String. sub src start_offset (end_offset - start_offset)
4242
4343 let extract_text_at_loc loc =
44- (* TODO: Maybe cache later on *)
45- let src = Ext_io. load_file loc.Location. loc_start.pos_fname in
46- extract_location_string ~src loc
44+ if loc.Location. loc_start.pos_fname = " _none_" then " "
45+ else
46+ try
47+ (* TODO: Maybe cache later on *)
48+ let src = Ext_io. load_file loc.Location. loc_start.pos_fname in
49+ extract_location_string ~src loc
50+ with _ -> " "
4751
4852 let parse_expr_at_loc loc =
4953 let sub_src = extract_text_at_loc loc in
Original file line number Diff line number Diff line change 1+
2+ [1;31mWe've found a bug for you![0m
3+ [36m/.../fixtures/extract_from_none_file.res[0m
4+
5+ This has type: [1;31mRegExp.t[0m
6+ But a [1;33mwhile[0m loop condition must always be of type: [1;33mbool[0m
Original file line number Diff line number Diff line change 1+ // This will try and extract the text from a non-existing file.
2+ // Test is intended to check that this does not crash.
3+ while / foo / {
4+ ()
5+ }
You can’t perform that action at this time.
0 commit comments