[project @ 2003-07-10 08:16:54 by simonpj]
authorsimonpj <unknown>
Thu, 10 Jul 2003 08:16:54 +0000 (08:16 +0000)
committersimonpj <unknown>
Thu, 10 Jul 2003 08:16:54 +0000 (08:16 +0000)
Give a more sensible type to big character literals in ExtCore (but it still looks odd to me)

ghc/compiler/coreSyn/MkExternalCore.lhs

index ff1834f..569655c 100644 (file)
@@ -26,6 +26,7 @@ import IdInfo
 import Id      ( idUnfolding )
 import CoreTidy        ( tidyExpr )
 import VarEnv  ( emptyTidyEnv )
+import TysPrim ( intPrimTy )
 import Literal
 import Name
 import CostCentre
@@ -164,7 +165,8 @@ make_lit :: Literal -> C.Lit
 make_lit l = 
   case l of
     MachChar i | i <= 0xff -> C.Lchar (chr i) t
-    MachChar i | otherwise -> C.Lint (toEnum i) t
+    MachChar i | otherwise -> C.Lint (toEnum i) (make_ty intPrimTy)
+       -- For 'big' characters, use an integer
     MachStr s -> C.Lstring (unpackFS s) t
     MachNullAddr -> C.Lint 0 t
     MachInt i -> C.Lint i t