File tree 5 files changed +24
-19
lines changed
5 files changed +24
-19
lines changed Original file line number Diff line number Diff line change 21
21
22
22
## Improved
23
23
24
+ - Pattern-matching redundancy is now a warning instead of an error.
25
+ [ \# 222] ( https://github.com/ocaml-gospel/gospel/pull/222 )
24
26
- Allow unit result in function header
25
27
[ \# 215] ( https://github.com/ocaml-gospel/gospel/pull/215 )
26
28
- Highlight source locations when reporting errors.
Original file line number Diff line number Diff line change @@ -568,4 +568,4 @@ let checks ~loc ty cases =
568
568
let tyl = ty :: bools in
569
569
check_exhaustive ~loc tyl pmat q bools;
570
570
check_redundancy ~loc tyl pmat
571
- with W. Warning e -> Fmt. epr " %a@." W. pp_warn e
571
+ with W. Warning e -> Fmt. pr " %a@." W. pp_warn e
Original file line number Diff line number Diff line change @@ -4,11 +4,12 @@ val f : int -> int
4
4
| _ -> true
5
5
| 1i -> false *)
6
6
(* {gospel_expected|
7
- [125 ] File "redundant1.mli", line 3, characters 12-58:
8
- 3 | ............match x with
9
- 4 | | _ -> true
10
- 5 | | 1i -> false...
11
- Error : The pattern-matching is redundant.
7
+ [0 ] File "redundant1.mli", line 3, characters 12-58:
8
+ 3 | ............match x with
9
+ 4 | | _ -> true
10
+ 5 | | 1i -> false...
11
+ Warning : The pattern-matching is redundant.
12
12
Here is a case that is unused:
13
13
1i.
14
+ OK
14
15
|gospel_expected} *)
Original file line number Diff line number Diff line change @@ -8,13 +8,14 @@ val f : t -> int
8
8
| B (B A) -> false
9
9
| _ -> true *)
10
10
(* {gospel_expected|
11
- [125 ] File "redundant2.mli", line 5, characters 12-103:
12
- 5 | ............match x with
13
- 6 | | A -> false
14
- 7 | | B (B _) -> false
15
- 8 | | B (B A) -> false
16
- 9 | | _ -> true...
17
- Error : The pattern-matching is redundant.
11
+ [0 ] File "redundant2.mli", line 5, characters 12-103:
12
+ 5 | ............match x with
13
+ 6 | | A -> false
14
+ 7 | | B (B _) -> false
15
+ 8 | | B (B A) -> false
16
+ 9 | | _ -> true...
17
+ Warning : The pattern-matching is redundant.
18
18
Here is a case that is unused:
19
19
B B A.
20
+ OK
20
21
|gospel_expected} *)
Original file line number Diff line number Diff line change @@ -7,12 +7,13 @@ val f : t -> int
7
7
| B (B A) -> false
8
8
| _ -> true *)
9
9
(* {gospel_expected|
10
- [125 ] File "redundant3.mli", line 5, characters 12-86:
11
- 5 | ............match x with
12
- 6 | | A | B _ -> false
13
- 7 | | B (B A) -> false
14
- 8 | | _ -> true...
15
- Error : The pattern-matching is redundant.
10
+ [0 ] File "redundant3.mli", line 5, characters 12-86:
11
+ 5 | ............match x with
12
+ 6 | | A | B _ -> false
13
+ 7 | | B (B A) -> false
14
+ 8 | | _ -> true...
15
+ Warning : The pattern-matching is redundant.
16
16
Here is a case that is unused:
17
17
B B A.
18
+ OK
18
19
|gospel_expected} *)
You can’t perform that action at this time.
0 commit comments