-Wincomplete-record-selectors wrong in the presence of -Wno-overlapping-patterns
On GHC 9.10, the following program incorrectly warns
{-# OPTIONS_GHC -Wno-overlapping-patterns #-}
{-# OPTIONS_GHC -Wincomplete-record-selectors #-}
module T25059 where
data AB = A { getA :: Int } | B { getB :: Bool }
foo :: AB -> Int
foo ab = case ab of
B {} -> 3
_ -> getA ab
T25059.hs:11:10: warning: [GHC-17335] [-Wincomplete-record-selectors]
The application of the record field `getA' may fail for the following constructors: B
|
11 | _ -> getA ab
| ^^^^^^^
Commenting out the line {-# OPTIONS_GHC -Wno-overlapping-patterns #-}
makes the module compile without warnings.
Edited by sheaf