[GHC] #8318: GHC does not infer type of `tagToEnum#` expression

GHC ghc-devs at haskell.org
Wed Nov 19 20:44:07 UTC 2014


#8318: GHC does not infer type of `tagToEnum#` expression
-------------------------------------+-------------------------------------
              Reporter:  jstolarek   |            Owner:
                  Type:  bug         |           Status:  new
              Priority:  normal      |        Milestone:
             Component:  Compiler    |          Version:  7.7
  (Type checker)                     |         Keywords:
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:  GHC         |  Related Tickets:
  rejects valid program              |
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
Changes (by thomie):

 * component:  Compiler => Compiler (Type checker)


Comment:

 The error message for the code from the description is improved using ghc
 HEAD. A regression test should be added.
 {{{
 $ ghc-7.9.20141115 test.hs
 [1 of 1] Compiling TTE              ( test.hs, test.o )

 test.hs:6:10:
     Bad call to tagToEnum# at type r_alE
       Specify the type by giving a type signature
       e.g. (tagToEnum# x) :: Bool
     In the expression: tagToEnum# 1#
     In the expression:
       case tagToEnum# 1# of {
         True -> "True"
         False -> "False" }
     In an equation for ‘f’:
         f = case tagToEnum# 1# of {
               True -> "True"
               False -> "False" }
 }}}

 See also commit 706c439fb5d3f1e30ad7b3953fde17dd01dae1bc:
 {{{
 Author: simonpj <simonpj at microsoft.com>
 Date:   Wed Aug 16 20:30:23 2006 +0000

     Add test for tagToEnum#
 }}}

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


More information about the ghc-tickets mailing list