[GHC] #16384: GHC infers ill-kinded type for typed TH splice with unlifted values

GHC ghc-devs at haskell.org
Mon Mar 4 16:26:22 UTC 2019


#16384: GHC infers ill-kinded type for typed TH splice with unlifted values
-------------------------------------+-------------------------------------
        Reporter:  gridaphobe        |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.6.3
      Resolution:                    |             Keywords:
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):

 Core Lint will complain about it as well:

 {{{#!hs
 {-# LANGUAGE MagicHash #-}
 {-# LANGUAGE TemplateHaskell #-}
 {-# OPTIONS_GHC -dcore-lint #-}
 module Bug where

 import GHC.Exts

 wat :: () -> Int#
 wat _ = $$([|| 1# ||])
 }}}
 {{{
 $ /opt/ghc/8.6.3/bin/ghc Bug.hs
 [1 of 1] Compiling Bug              ( Bug.hs, Bug.o )
 *** Core Lint errors : in result of hscCompileExpr ***
 <no location info>: warning:
     In the expression: unsafeTExpCoerce @ Int# sat_s3Mx
     Kinds don't match in type application:
     Type variable: a_a3mR :: *
     Arg type: Int# :: TYPE 'IntRep
     Linted Arg kind: TYPE 'IntRep
 *** Offending Program ***
 let {
   sat_s3Mx :: Q Exp
   [LclId]
   sat_s3Mx
     = let {
         sat_s3Mw :: Lit
         [LclId]
         sat_s3Mw
           = let {
               sat_s3M1 :: Integer
               [LclId]
               sat_s3M1 = S# 1# } in
             intPrimL sat_s3M1 } in
       litE sat_s3Mw } in
 unsafeTExpCoerce @ Int# sat_s3Mx
 *** End of Offense ***


 <no location info>: error:
 Compilation had errors
 }}}

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


More information about the ghc-tickets mailing list