[GHC] #14180: Strange/bad error message binding unboxed type variable

GHC ghc-devs at haskell.org
Tue Aug 21 14:44:34 UTC 2018


#14180: Strange/bad error message binding unboxed type variable
-------------------------------------+-------------------------------------
        Reporter:  dfeuer            |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.2.3
       Component:  Compiler (Type    |              Version:  8.3
  checker)                           |
      Resolution:                    |             Keywords:  TypeInType
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 For what it's worth, the situation here appears to have changed slightly
 between GHC 8.4.3 and 8.6.1. In 8.4.3, one could work around this issue by
 replacing the `x` (in `MatchInt ('I# x) = '()`) with `_`. However, this is
 no longer be the case in 8.6.1, where even replacing `x` with `_` will
 yield this error:

 {{{
 Bug.hs:6:17: error:
     • Couldn't match a lifted type with an unlifted type
       When matching kinds
         k0 :: *
         Int# :: TYPE 'IntRep
       Expected kind ‘Int#’, but ‘_’ has kind ‘k0’
     • In the first argument of ‘ 'I#’, namely ‘_’
       In the first argument of ‘MatchInt’, namely ‘( 'I# _)’
       In the type family declaration for ‘MatchInt’
   |
 6 |   MatchInt ('I# _) = '()
   |                 ^
 }}}

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


More information about the ghc-tickets mailing list