Skip to content

Wrong "Pattern match is redundant" in 9.2.1

Summary

GHC 9.2.1 claims

engine-src/Game/LambdaHack/Client/UI/MonadClientUI.hs:137:9: warning: [-Woverlapping-patterns]
    Pattern match is redundant
    In a case alternative: [] -> ...
    |
137 |         [] -> []

for this line

https://github.com/LambdaHack/LambdaHack/blob/974d25a2aed2ad45e9b5ab2653f17c30f484f8c0/engine-src/Game/LambdaHack/Client/UI/MonadClientUI.hs#L137

and the warning is plain wrong. There is also a second equally wrong such warning. Nothing special about that code, no fancy types, no redefined syntax.

Steps to reproduce

git clone https://github.com/LambdaHack/LambdaHack.git
cabal build --allow-newer

Expected behavior

No warnings about redundant pattern matches, as in GHC 8.10.7.

Environment

  • GHC version used: 9.2.1

Optional:

  • Operating System: Ubuntu
  • System Architecture: x86_64-linux
Edited by Mikolaj Konarski
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information