[GHC] #8853: Alarming looking warning about non-exhaustive pattern

GHC ghc-devs at haskell.org
Thu Mar 6 19:41:38 UTC 2014


#8853: Alarming looking warning about non-exhaustive pattern
-------------------------+-------------------------------------------------
       Reporter:         |             Owner:
  MikolajKonarski        |            Status:  new
           Type:  bug    |         Milestone:
       Priority:         |           Version:  7.8.1-rc2
  normal                 |  Operating System:  Linux
      Component:         |   Type of failure:  Incorrect warning at
  Compiler               |  compile-time
       Keywords:         |         Test Case:
   Architecture:         |          Blocking:
  x86_64 (amd64)         |
     Difficulty:         |
  Unknown                |
     Blocked By:         |
Related Tickets:         |
-------------------------+-------------------------------------------------
 The attached code produces this alarming warning:

 ~/waste$ ghc --version
 The Glorious Glasgow Haskell Compilation System, version 7.8.0.20140228
 ~/waste$ ghc -Wall --make AlarmingPattern.hs -fforce-recomp
 [1 of 1] Compiling Main             ( AlarmingPattern.hs,
 AlarmingPattern.o )

 AlarmingPattern.hs:6:7: Warning:
     Pattern match(es) are non-exhaustive
     In an equation for ‘takeFromInv’:
         Patterns not matched:
             (GHC.Types.I# _) (GHC.Types.I# (#x)) with #x `notElem` [0#]
 Linking AlarmingPattern ...
 ~/waste$ ./AlarmingPattern
 AlarmingPattern: AlarmingPattern.hs:(6,7)-(7,26): Non-exhaustive patterns
 in function takeFromInv

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8853>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list