GHC 9.0.1-rc1: Incorrect warning -Wincomplete-patterns when using Template Haskell
Compiling the following example from the documentation of the gitrev library:
{-# LANGUAGE TemplateHaskell #-}
import Development.GitRev
panic :: String -> a
panic msg = error panicMsg
where panicMsg =
concat [ "[panic ", $(gitBranch), "@", $(gitHash)
, " (", $(gitCommitDate), ")"
, " (", $(gitCommitCount), " commits in HEAD)"
, dirty, "] ", msg ]
dirty | $(gitDirty) = " (uncommitted files present)"
| otherwise = ""
main = panic "oh no!"
generates the following invalid warning:
Example.hs:12:17: warning: [-Woverlapping-patterns]
Pattern match is redundant
In an equation for ‘dirty’: dirty | (False) = ...
|
12 | dirty | $(gitDirty) = " (uncommitted files present)"
| ^^^^^^^^^^^
The above warning is not generated with GHC 8.10.3.