Skip to content

Core lint error with Template Haskell quotation and type lits

When I compile

{-# LANGUAGE TemplateHaskell, DataKinds #-}

ty = [t| 5 |]

I get

*** Core Lint errors : in result of Desugar (after optimization) ***
<no location info>: Warning:
    In the expression: Language.Haskell.TH.Lib.numTyLit
                         (GHC.Types.I# 5)
    Argument value doesn't match argument type:
    Fun type:
        GHC.Integer.Type.Integer -> Language.Haskell.TH.Lib.TyLitQ
    Arg type: GHC.Types.Int
    Arg: GHC.Types.I# 5
*** Offending Program ***
Main.ty :: Language.Haskell.TH.Lib.TypeQ
[LclIdX, Str=DmdType]
Main.ty =
  break<0>()
  Language.Haskell.TH.Lib.litT
    (Language.Haskell.TH.Lib.numTyLit (GHC.Types.I# 5))

*** End of Offense ***

I'm pretty sure I know what's going on. I will fix.

Trac metadata
Trac field Value
Version 7.7
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Template Haskell
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information