[GHC] #8853: Surprising mention of unboxed integers in pattern exhaustiveness warning

GHC ghc-devs at haskell.org
Fri Nov 7 14:47:40 UTC 2014


#8853: Surprising mention of unboxed integers in pattern exhaustiveness warning
-------------------------------------+-------------------------------------
              Reporter:              |            Owner:
  MikolajKonarski                    |           Status:  new
                  Type:  bug         |        Milestone:
              Priority:  normal      |          Version:  7.8.1-rc2
             Component:  Compiler    |         Keywords:
            Resolution:              |     Architecture:  x86_64 (amd64)
      Operating System:  Linux       |       Difficulty:  Unknown
       Type of failure:  Incorrect   |       Blocked By:
  warning at compile-time            |  Related Tickets:
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Old description:

> 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
> }}}

New description:

 The attached code produces this alarming warning:

 {{{
 ~/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 ...
 }}}
 The error message is alarming because it refers to unboxed integers, but
 the source code does not.

--

Comment (by thomie):

 Reproducable with version 7.9.20140802.
 This ticket is listed on [wiki:Status/SLPJ-Tickets].

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


More information about the ghc-tickets mailing list