Skip to content

Commit 4c1905e

Browse files
committed
Port reanalyze deadcode example code to ReScript v11
1 parent e045914 commit 4c1905e

35 files changed

+493
-696
lines changed

analysis/reanalyze/examples/deadcode/expected/deadcode.txt

Lines changed: 177 additions & 301 deletions
Large diffs are not rendered by default.
Lines changed: 39 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11

22

33
Exception Analysis
4-
Exn.res:1:5-10
5-
raises might raise Not_found (Exn.res:1:19) and is not annotated with @raises(Not_found)
4+
BsJson.res:4:5-15
5+
testBsJson2 raises nothing and is annotated with redundant @raises(JsonCombinators.DecodeError)
6+
7+
Exception Analysis
8+
Exn.res:17:5-23
9+
raisesWithAnnotaion raises nothing and is annotated with redundant @raises(Not_found)
610

711
Exception Analysis
812
Exn.res:19:5-28
@@ -24,45 +28,33 @@
2428
Exn.res:26:5-19
2529
incompleteMatch might raise Match_failure (Exn.res:27:2) and is not annotated with @raises(Match_failure)
2630

27-
Exception Analysis
28-
Exn.res:34:5-13
29-
twoRaises might raise [A (Exn.res:36:4), B (Exn.res:39:4)] and is not annotated with @raises([A, B])
30-
31-
Exception Analysis
32-
Exn.res:43:5-14
33-
sequencing might raise A (Exn.res:44:2) and is not annotated with @raises(A)
34-
35-
Exception Analysis
36-
Exn.res:50:5-14
37-
wrongCatch might raise B (Exn.res:51:6) and is not annotated with @raises(B)
38-
3931
Exception Analysis
4032
Exn.res:56:5-15
41-
wrongCatch2 might raise [C (Exn.res:57:24), Match_failure (Exn.res:57:2)] and is not annotated with @raises([C, Match_failure])
33+
wrongCatch2 might raise Match_failure (Exn.res:57:2) and is not annotated with @raises(Match_failure)
4234

4335
Exception Analysis
4436
Exn.res:64:5-19
45-
raise2Annotate3 might raise [A (Exn.res:66:4), B (Exn.res:69:4)] and is annotated with redundant @raises(C)
37+
raise2Annotate3 raises nothing and is annotated with redundant @raises([A, B, C])
4638

4739
Exception Analysis
48-
Exn.res:75:5-24
49-
parse_json_from_file might raise Error (Exn.res:78:4) and is not annotated with @raises(Error)
40+
Exn.res:100:5-16
41+
indirectCall might raise Not_found (Exn.res:100:31) and is not annotated with @raises(Not_found)
5042

5143
Exception Analysis
52-
Exn.res:84:5-11
53-
reRaise might raise B (Exn.res:86:19) and is not annotated with @raises(B)
44+
Exn.res:125:5-13
45+
raiseAtAt raises nothing and is annotated with redundant @raises(Not_found)
5446

5547
Exception Analysis
56-
Exn.res:95:5-22
57-
raiseInInternalLet might raise A (Exn.res:96:14) and is not annotated with @raises(A)
48+
Exn.res:128:5-13
49+
raisePipe raises nothing and is annotated with redundant @raises(Not_found)
5850

5951
Exception Analysis
60-
Exn.res:100:5-16
61-
indirectCall might raise Not_found (Exn.res:100:31) and is not annotated with @raises(Not_found)
52+
Exn.res:131:5-14
53+
raiseArrow raises nothing and is annotated with redundant @raises(Not_found)
6254

6355
Exception Analysis
64-
Exn.res:148:5-16
65-
severalCases might raise Failure (Exn.res:150:13 Exn.res:151:13 Exn.res:152:15) and is not annotated with @raises(Failure)
56+
Exn.res:157:5-30
57+
genericRaiseIsNotSupported raises nothing and is annotated with redundant @raises(genericException)
6658

6759
Exception Analysis
6860
Exn.res:159:32-56
@@ -89,24 +81,12 @@
8981
String.uncapitalize_ascii does not raise and is annotated with redundant @doesNotRaise
9082

9183
Exception Analysis
92-
Exn.res:176:5-23
93-
redundantAnnotation raises nothing and is annotated with redundant @raises(Invalid_argument)
94-
95-
Exception Analysis
96-
Exn.res:178:5-6
97-
_x might raise A (Exn.res:178:9) and is not annotated with @raises(A)
98-
99-
Exception Analysis
100-
Exn.res:180:5
101-
_ might raise A (Exn.res:180:8) and is not annotated with @raises(A)
102-
103-
Exception Analysis
104-
Exn.res:182:5-6
105-
() might raise A (Exn.res:182:9) and is not annotated with @raises(A)
84+
Exn.res:173:5-9
85+
exits raises nothing and is annotated with redundant @raises(exit)
10686

10787
Exception Analysis
108-
Exn.res:184:1-16
109-
Toplevel expression might raise Not_found (Exn.res:184:0) and is not annotated with @raises(Not_found)
88+
Exn.res:176:5-23
89+
redundantAnnotation raises nothing and is annotated with redundant @raises(Invalid_argument)
11090

11191
Exception Analysis
11292
Exn.res:186:1-19
@@ -123,5 +103,21 @@
123103
Exception Analysis
124104
ExnA.res:1:5-7
125105
bar might raise Not_found (ExnA.res:1:16) and is not annotated with @raises(Not_found)
106+
107+
Exception Analysis
108+
ExnB.res:2:5-7
109+
foo raises nothing and is annotated with redundant @raises(Not_found)
110+
111+
Exception Analysis
112+
InnerModules.res:2:5-15
113+
wrapExitTop raises nothing and is annotated with redundant @raises(exit)
114+
115+
Exception Analysis
116+
InnerModules.res:6:7-16
117+
wrapExitM1 raises nothing and is annotated with redundant @raises(exit)
118+
119+
Exception Analysis
120+
InnerModules.res:16:9-18
121+
wrapExitM2 raises nothing and is annotated with redundant @raises(exit)
126122

127-
Analysis reported 31 issues (Exception Analysis:31)
123+
Analysis reported 30 issues (Exception Analysis:30)

analysis/reanalyze/examples/deadcode/package-lock.json

Lines changed: 67 additions & 107 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

analysis/reanalyze/examples/deadcode/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
"version": "0.1.0",
44
"private": true,
55
"devDependencies": {
6-
"react": "^16.13.1",
7-
"react-dom": "^16.8.6",
8-
"rescript": "^10.1.2"
6+
"react": "^18.2.0",
7+
"react-dom": "^18.2.0",
8+
"rescript": "^11.1.4"
99
},
1010
"dependencies": {
11-
"@glennsl/bs-json": "^5.0.4",
12-
"@rescript/react": "^0.10.3"
11+
"@glennsl/rescript-json-combinators": "^1.4.0",
12+
"@rescript/react": "^0.13.0"
1313
}
1414
}

0 commit comments

Comments
 (0)