Skip to content

No non-exhaustive pattern match warning given for empty case analysis

I would expect GHC to warn of a non-exhaustive pattern match at compile-time when faced with this,

{-# LANGUAGE EmptyCase #-}
module Test where

test :: Bool -> Int
test a = case a of

Yet it happily accepts this without complaint. If one attempts to evaluate, e.g., test True the expected "Non-exhaustive patterns in case" error is thrown at runtime.

Trac metadata
Trac field Value
Version 7.10.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC edsko
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information