-Wincomplete-patterns is affected by -g3
Program
module A where
data Z = A | B | C ()
data W = W ()
foo :: ()
foo = ()
where
partitionByWorkerSize worker_size pats = go pats [] []
where
go [] small warnings = (small, warnings)
go (p:ps) small warnings
| A <- worker_size p
= go ps (p:small) warnings
| B <- worker_size p
= go ps small warnings
| C name <- worker_size p
= go ps small (W name : warnings)
This program doesn't warn normally but does with -g3
> ghc A.hs -Wall -Wincomplete-patterns -fforce-recomp -g3
A.hs:12:9: warning: [GHC-62161] [-Wincomplete-patterns]
Pattern match(es) are non-exhaustive
In an equation for ‘go’:
Patterns of type ‘[t]’, ‘[t]’, ‘[W]’ not matched: (_:_) _ _
|
12 | go [] small warnings = (small, warnings)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
Edited by sheaf