File tree Expand file tree Collapse file tree 3 files changed +17
-20
lines changed
tests/tools_tests/src/expected Expand file tree Collapse file tree 3 files changed +17
-20
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,15 @@ let get_saved_types () = !saved_types
167
167
let set_saved_types l = saved_types := l
168
168
169
169
let record_deprecated_used ?deprecated_context ?migration_template ?migration_in_pipe_chain_template source_loc deprecated_text =
170
- deprecated_used := {Cmt_utils. source_loc; deprecated_text; migration_template; migration_in_pipe_chain_template; context = deprecated_context} :: ! deprecated_used
170
+ deprecated_used :=
171
+ {
172
+ Cmt_utils. source_loc;
173
+ deprecated_text;
174
+ migration_template;
175
+ migration_in_pipe_chain_template;
176
+ context = deprecated_context;
177
+ }
178
+ :: ! deprecated_used
171
179
172
180
let _ = Cmt_utils. record_deprecated_used := record_deprecated_used
173
181
@@ -210,4 +218,4 @@ let save_cmt filename modname binary_annots sourcefile initial_env cmi =
210
218
output_cmt oc cmt)
211
219
end ;
212
220
clear ()
213
- #endif
221
+ #endif
Original file line number Diff line number Diff line change 1
1
/* Migration tests for interface (.resi) files using stdlib deprecations */
2
2
3
3
// Type alias migrations exercised via externals
4
- external arr: JSON.t <int> = "arr"
5
- external reT: Js.Re .t = "re"
6
- external json: Js.Json .t = "json"
7
- external nestedArr: Js.Array.t<Js.Re .t> = "nestedArr"
4
+ external arr: array <int> = "arr"
5
+ external reT: RegExp .t = "re"
6
+ external json: JSON .t = "json"
7
+ external nestedArr: array<RegExp .t> = "nestedArr"
8
8
9
9
// Function type using a deprecated alias
10
- external useSet: Js. Set.t<int> => unit = "useSet"
10
+ external useSet: Set.t<int> => unit = "useSet"
11
11
Original file line number Diff line number Diff line change @@ -703,19 +703,8 @@ let migrate ~entryPointFile ~outputMode =
703
703
let {Res_driver. parsetree = signature; comments; source} =
704
704
parser ~filename: path
705
705
in
706
- (* Load cmti/cmt info to obtain deprecation migration templates, just like .res *)
707
- match
708
- (* Prefer implementation cmt info when available, since cmti may not
709
- record deprecated usages. Fallback to cmti if needed. *)
710
- let impl_path =
711
- if Filename. check_suffix path " .resi" then
712
- Filename. chop_suffix path " .resi" ^ " .res"
713
- else path
714
- in
715
- match Cmt. loadCmtInfosFromPath ~path: impl_path with
716
- | Some infos -> Some infos
717
- | None -> Cmt. loadCmtInfosFromPath ~path
718
- with
706
+
707
+ match Cmt. loadCmtInfosFromPath ~path with
719
708
| None ->
720
709
Error
721
710
(Printf. sprintf
You can’t perform that action at this time.
0 commit comments