-
Couldn't load subscription status.
- Fork 75
Open
Description
Description
If a match clause only has 2 cases, and the last case is _, then the whole thing can be converted into a simple if-then-else block, which is more readable.
Test1:
match foo with
| bar -> ()
| _ -> ()
Should throw warnings.
Test2:
match foo with
| bar -> ()
| baz -> ()
| _ -> ()
Should not throw warnings (because it has 3 cases, not 2).
Test3:
match foo with
| bar -> ()
| baz -> ()
Should not throw warnings (because its last case is not _).
Test4:
match foo with
| Bar baz -> ()
| _ -> ()
Should not throw warnings (because its first case is not a single element, so the casting is useful).
Metadata
Metadata
Assignees
Labels
No labels