Skip to content

Commit 9ddceca

Browse files
committed
[src][input][2/n] read cmi_infos from .cmti and .cmt
If a `.ml` has a `.mli` then its interface is available as `cmi_infos` in the `.cmti`. Otherwise, there is no `.cmti` and it is available in the`.cmt`. All FN and FP introduced by the previous commit are fixed.
1 parent 0f0878c commit 9ddceca

File tree

7 files changed

+479
-437
lines changed

7 files changed

+479
-437
lines changed

check/classic/classic.ref

Lines changed: 48 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@
1414
./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure
1515
./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int
1616
./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int
17-
./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected
18-
./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected
19-
./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected
20-
./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected
21-
./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected
17+
./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int
18+
./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int
19+
./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun
20+
./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun
21+
./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure
22+
2223
./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg
2324
./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg
2425
./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg
@@ -33,35 +34,38 @@
3334
./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure
3435
./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int
3536
./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int
36-
./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected
37-
./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected
38-
./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected
39-
./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected
40-
./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected
37+
./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int
38+
./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int
39+
./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun
40+
./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun
41+
./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure
42+
4143
./examples/using_make/advanced/inc_val.mli:1: x
4244
./examples/using_make/advanced/inc_val.mli:2: y
4345
./examples/using_make/advanced/val.mli:1: x: Should not be detected
4446
./examples/using_make/advanced/val.mli:2: y: Should not be detected
45-
./examples/using_make/bar.ml:1: x: Not detected
46-
./examples/using_make/bar_fn.ml:3: h: Not detected
47+
./examples/using_make/bar.ml:1: x
48+
./examples/using_make/bar_fn.ml:3: h
4749
./examples/using_make/baz.mli:1: z
4850
./examples/using_make/baz.mli:3: u
49-
./examples/using_make/cond_sel.ml:13: h: Not detected
50-
./examples/using_make/dir/alias_opt.ml:7: y: Not detected
51-
./examples/using_make/dir/alias_opt.ml:14: x: Not detected
52-
./examples/using_make/dir/anon_call.ml:1: f: Not detected
53-
./examples/using_make/dir/anon_call.ml:5: g: Not detected
54-
./examples/using_make/dir/anon_call.ml:9: h: Not detected
55-
./examples/using_make/dir/anon_call2.ml:1: f: Not detected
56-
./examples/using_make/dir/anon_call2.ml:5: g: Not detected
57-
./examples/using_make/dir/anon_call2.ml:9: h: Not detected
58-
./examples/using_make/dir/match_opt.ml:8: l: Not detected
59-
./examples/using_make/dir/matchopt.ml:5: w: Not detected
51+
./examples/using_make/cond_sel.ml:13: h
52+
53+
./examples/using_make/dir/alias_opt.ml:7: y
54+
./examples/using_make/dir/alias_opt.ml:14: x
55+
./examples/using_make/dir/anon_call.ml:1: f
56+
./examples/using_make/dir/anon_call.ml:5: g
57+
./examples/using_make/dir/anon_call.ml:9: h
58+
./examples/using_make/dir/anon_call2.ml:1: f
59+
./examples/using_make/dir/anon_call2.ml:5: g
60+
./examples/using_make/dir/anon_call2.ml:9: h
61+
./examples/using_make/dir/match_opt.ml:8: l
62+
./examples/using_make/dir/matchopt.ml:5: w
6063
./examples/using_make/dir/mod.mli:10: M.f
6164
./examples/using_make/dir/mod.mli:11: M.g
6265
./examples/using_make/dir/refFn.mli:3: x
63-
./examples/using_make/dir/ref_opt.ml:3: no: Not detected
64-
./examples/using_make/dir/ref_opt.ml:11: x: Not detected
66+
./examples/using_make/dir/ref_opt.ml:3: no
67+
./examples/using_make/dir/ref_opt.ml:11: x
68+
6569
./examples/using_make/exported.mli:6: M1.five
6670
./examples/using_make/exported.mli:10: F.plus_five
6771
./examples/using_make/exported.mli:11: F.times_five
@@ -74,9 +78,9 @@
7478
./examples/using_make/functor.mli:3: M.none
7579
./examples/using_make/functor.mli:7: F.g
7680
./examples/using_make/functor.mli:11: N.g
77-
./examples/using_make/let_in.ml:3: parent: Not detected
78-
./examples/using_make/let_test.ml:3: g: Not detected
79-
./examples/using_make/matchopt.ml:5: w: Not detected
81+
./examples/using_make/let_in.ml:3: parent
82+
./examples/using_make/let_test.ml:3: g
83+
./examples/using_make/matchopt.ml:5: w
8084
./examples/using_make/mod_alias.mli:2: M1.id
8185
./examples/using_make/mod_alias.mli:6: M2.id
8286

@@ -85,11 +89,11 @@
8589
./examples/using_make/obj/inher.mli:11: o
8690
./examples/using_make/obj/inher.mli:13: f
8791

88-
./examples/using_make/opt_in_opt.ml:7: x: Not detected
89-
./examples/using_make/qux.ml:1: z: Not detected
90-
./examples/using_make/unused_fn.ml:3: g: Not detected
91-
./examples/using_make/unused_fn.ml:5: var: Not detected
92-
./examples/using_make/useless_opt.ml:3: x: Not detected
92+
./examples/using_make/opt_in_opt.ml:7: x
93+
./examples/using_make/qux.ml:1: z
94+
./examples/using_make/unused_fn.ml:3: g
95+
./examples/using_make/unused_fn.ml:5: var
96+
./examples/using_make/useless_opt.ml:3: x
9397
./examples/using_make/variant.mli:5: f
9498

9599
Nothing else to report in this section
@@ -128,23 +132,22 @@ Nothing else to report in this section
128132
./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected
129133
./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected
130134
./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected
131-
./examples/using_make/advanced/mod.mli:4: p#f: Should not be detected
132135
./examples/using_make/obj/class.mli:1: c#h
133136
./examples/using_make/obj/class_type.mli:9: c#h
134137
./examples/using_make/obj/coerce.mli:6: p#f
135138
./examples/using_make/obj/coerce.mli:6: p#h
136-
./examples/using_make/obj/constraint.ml:1: p#g: Not detected
139+
./examples/using_make/obj/constraint.ml:1: p#g
137140
./examples/using_make/obj/fooCl.mli:1: p1#g
138141
./examples/using_make/obj/fooCl.mli:1: p1#h
139142
./examples/using_make/obj/fooCl.mli:7: p2#h
140-
./examples/using_make/obj/fun_class.ml:1: c#m3: Not detected
141-
./examples/using_make/obj/fun_obj_param.ml:1: f#n: Not detected
143+
./examples/using_make/obj/fun_class.ml:1: c#m3
144+
./examples/using_make/obj/fun_obj_param.ml:1: f#n
142145
./examples/using_make/obj/inher.mli:1: p#h
143146
./examples/using_make/obj/named.mli:10: c#g
144-
./examples/using_make/obj/obj_inher.ml:1: c#g: Not detected
145-
./examples/using_make/obj/obj_inher.ml:1: c#h: Not detected
146-
./examples/using_make/obj/obj_inher.ml:19: o3#k: Not detected
147-
./examples/using_make/obj/object.ml:1: o#h: Not detected
147+
./examples/using_make/obj/obj_inher.ml:1: c#g
148+
./examples/using_make/obj/obj_inher.ml:1: c#h
149+
./examples/using_make/obj/obj_inher.ml:19: o3#k
150+
./examples/using_make/obj/object.ml:1: o#h
148151
./examples/using_make/obj/overr.mli:1: p1#g
149152
./examples/using_make/obj/overr.mli:1: p1#h
150153
./examples/using_make/obj/overr.mli:7: p2#g
@@ -499,7 +502,7 @@ Nothing else to report in this section
499502
--------------------------------------------------------------------------------
500503

501504

502-
Total: 439
503-
Success: 377
504-
Failed: 62
505-
Ratio: 85.8769931663%
505+
Total: 438
506+
Success: 417
507+
Failed: 21
508+
Ratio: 95.2054794521%

check/internal/internal.ref

Lines changed: 48 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616
./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected
1717
./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int
1818
./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected
19-
./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected
20-
./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected
21-
./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected
22-
./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected
23-
./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected
19+
./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int
20+
./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int
21+
./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun
22+
./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun
23+
./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure
24+
2425
./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg
2526
./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected
2627
./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected
@@ -37,35 +38,38 @@
3738
./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected
3839
./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int
3940
./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected
40-
./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected
41-
./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected
42-
./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected
43-
./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected
44-
./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected
41+
./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int
42+
./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int
43+
./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun
44+
./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun
45+
./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure
46+
4547
./examples/using_make/advanced/inc_val.mli:1: x
4648
./examples/using_make/advanced/inc_val.mli:2: y
4749
./examples/using_make/advanced/val.mli:1: x: Should not be detected
4850
./examples/using_make/advanced/val.mli:2: y: Should not be detected
49-
./examples/using_make/bar.ml:1: x: Not detected
50-
./examples/using_make/bar_fn.ml:3: h: Not detected
51+
./examples/using_make/bar.ml:1: x
52+
./examples/using_make/bar_fn.ml:3: h
5153
./examples/using_make/baz.mli:1: z
5254
./examples/using_make/baz.mli:3: u
53-
./examples/using_make/cond_sel.ml:13: h: Not detected
54-
./examples/using_make/dir/alias_opt.ml:7: y: Not detected
55-
./examples/using_make/dir/alias_opt.ml:14: x: Not detected
56-
./examples/using_make/dir/anon_call.ml:1: f: Not detected
57-
./examples/using_make/dir/anon_call.ml:5: g: Not detected
58-
./examples/using_make/dir/anon_call.ml:9: h: Not detected
59-
./examples/using_make/dir/anon_call2.ml:1: f: Not detected
60-
./examples/using_make/dir/anon_call2.ml:5: g: Not detected
61-
./examples/using_make/dir/anon_call2.ml:9: h: Not detected
62-
./examples/using_make/dir/match_opt.ml:8: l: Not detected
63-
./examples/using_make/dir/matchopt.ml:5: w: Not detected
55+
./examples/using_make/cond_sel.ml:13: h
56+
57+
./examples/using_make/dir/alias_opt.ml:7: y
58+
./examples/using_make/dir/alias_opt.ml:14: x
59+
./examples/using_make/dir/anon_call.ml:1: f
60+
./examples/using_make/dir/anon_call.ml:5: g
61+
./examples/using_make/dir/anon_call.ml:9: h
62+
./examples/using_make/dir/anon_call2.ml:1: f
63+
./examples/using_make/dir/anon_call2.ml:5: g
64+
./examples/using_make/dir/anon_call2.ml:9: h
65+
./examples/using_make/dir/match_opt.ml:8: l
66+
./examples/using_make/dir/matchopt.ml:5: w
6467
./examples/using_make/dir/mod.mli:10: M.f: Should not be detected
6568
./examples/using_make/dir/mod.mli:11: M.g
6669
./examples/using_make/dir/refFn.mli:3: x
67-
./examples/using_make/dir/ref_opt.ml:3: no: Not detected
68-
./examples/using_make/dir/ref_opt.ml:11: x: Not detected
70+
./examples/using_make/dir/ref_opt.ml:3: no
71+
./examples/using_make/dir/ref_opt.ml:11: x
72+
6973
./examples/using_make/exported.mli:11: F.times_five: Not detected
7074
./examples/using_make/exported.mli:17: M2.ten: Not detected
7175
./examples/using_make/exported.mli:6: M1.five: Should not be detected
@@ -80,20 +84,20 @@
8084
./examples/using_make/functor.mli:3: M.none
8185
./examples/using_make/functor.mli:7: F.g: Should not be detected
8286
./examples/using_make/functor.mli:11: N.g: Should not be detected
83-
./examples/using_make/let_in.ml:3: parent: Not detected
84-
./examples/using_make/let_test.ml:3: g: Not detected
85-
./examples/using_make/matchopt.ml:5: w: Not detected
87+
./examples/using_make/let_in.ml:3: parent
88+
./examples/using_make/let_test.ml:3: g
89+
./examples/using_make/matchopt.ml:5: w
8690
./examples/using_make/mod_alias.mli:2: M1.id: Should not be detected
8791
./examples/using_make/mod_alias.mli:6: M2.id: Should not be detected
8892
./examples/using_make/obj/class.mli:7: o: Should not be detected
8993
./examples/using_make/obj/class.mli:9: f: Should not be detected
9094
./examples/using_make/obj/inher.mli:11: o: Should not be detected
9195
./examples/using_make/obj/inher.mli:13: f: Should not be detected
92-
./examples/using_make/opt_in_opt.ml:7: x: Not detected
93-
./examples/using_make/qux.ml:1: z: Not detected
94-
./examples/using_make/unused_fn.ml:3: g: Not detected
95-
./examples/using_make/unused_fn.ml:5: var: Not detected
96-
./examples/using_make/useless_opt.ml:3: x: Not detected
96+
./examples/using_make/opt_in_opt.ml:7: x
97+
./examples/using_make/qux.ml:1: z
98+
./examples/using_make/unused_fn.ml:3: g
99+
./examples/using_make/unused_fn.ml:5: var
100+
./examples/using_make/useless_opt.ml:3: x
97101
./examples/using_make/variant.mli:5: f: Should not be detected
98102
Nothing else to report in this section
99103
--------------------------------------------------------------------------------
@@ -131,23 +135,22 @@ Nothing else to report in this section
131135
./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected
132136
./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected
133137
./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected
134-
./examples/using_make/advanced/mod.mli:4: p#f: Should not be detected
135138
./examples/using_make/obj/class.mli:1: c#h
136139
./examples/using_make/obj/class_type.mli:9: c#h
137140
./examples/using_make/obj/coerce.mli:6: p#f
138141
./examples/using_make/obj/coerce.mli:6: p#h
139-
./examples/using_make/obj/constraint.ml:1: p#g: Not detected
142+
./examples/using_make/obj/constraint.ml:1: p#g
140143
./examples/using_make/obj/fooCl.mli:1: p1#g
141144
./examples/using_make/obj/fooCl.mli:1: p1#h
142145
./examples/using_make/obj/fooCl.mli:7: p2#h
143-
./examples/using_make/obj/fun_class.ml:1: c#m3: Not detected
144-
./examples/using_make/obj/fun_obj_param.ml:1: f#n: Not detected
146+
./examples/using_make/obj/fun_class.ml:1: c#m3
147+
./examples/using_make/obj/fun_obj_param.ml:1: f#n
145148
./examples/using_make/obj/inher.mli:1: p#h
146149
./examples/using_make/obj/named.mli:10: c#g
147-
./examples/using_make/obj/obj_inher.ml:1: c#g: Not detected
148-
./examples/using_make/obj/obj_inher.ml:1: c#h: Not detected
149-
./examples/using_make/obj/obj_inher.ml:19: o3#k: Not detected
150-
./examples/using_make/obj/object.ml:1: o#h: Not detected
150+
./examples/using_make/obj/obj_inher.ml:1: c#g
151+
./examples/using_make/obj/obj_inher.ml:1: c#h
152+
./examples/using_make/obj/obj_inher.ml:19: o3#k
153+
./examples/using_make/obj/object.ml:1: o#h
151154
./examples/using_make/obj/overr.mli:1: p1#g
152155
./examples/using_make/obj/overr.mli:1: p1#h
153156
./examples/using_make/obj/overr.mli:7: p2#g
@@ -502,7 +505,7 @@ Nothing else to report in this section
502505
--------------------------------------------------------------------------------
503506

504507

505-
Total: 447
506-
Success: 340
507-
Failed: 107
508-
Ratio: 76.062639821%
508+
Total: 446
509+
Success: 380
510+
Failed: 66
511+
Ratio: 85.201793722%

0 commit comments

Comments
 (0)