Skip to content

Empty case causes warning

The following code

{-# LANGUAGE EmptyCase #-}
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
data Void

foo :: Void -> ()
foo x = case x of {}

causes this warning

/Users/rae/temp/Scratch.hs:6:9: Warning:
    Pattern match(es) are non-exhaustive
    In a case alternative: Patterns not matched:
Ok, modules loaded: Main.
Trac metadata
Trac field Value
Version 7.7
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information