X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FdeSugar%2FDsMeta.hs;h=7d9b717b5552de6f4956f96d642f096bd4fb9b9f;hp=ca4fae42197c54c08a8bd4e394e493a3f4ef682a;hb=c97c0ab354da338854574f9c1fb89f7db061d4ae;hpb=6eb5c1509c2fd796c135ae18b650ddd658c48624 diff --git a/compiler/deSugar/DsMeta.hs b/compiler/deSugar/DsMeta.hs index ca4fae4..7d9b717 100644 --- a/compiler/deSugar/DsMeta.hs +++ b/compiler/deSugar/DsMeta.hs @@ -19,6 +19,7 @@ -- any warnings in the module. See -- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings -- for details +-- The kludge is only needed in this module because of trac #2267. module DsMeta( dsBracket, templateHaskellNames, qTyConName, nameTyConName, @@ -1293,15 +1294,19 @@ mk_rational :: Rational -> DsM HsLit mk_rational r = do rat_ty <- lookupType rationalTyConName return $ HsRat r rat_ty mk_string :: FastString -> DsM HsLit -mk_string s = do return $ HsString s +mk_string s = return $ HsString s repOverloadedLiteral :: HsOverLit Name -> DsM (Core TH.Lit) -repOverloadedLiteral (HsIntegral i _ _) = do { lit <- mk_integer i; repLiteral lit } -repOverloadedLiteral (HsFractional f _ _) = do { lit <- mk_rational f; repLiteral lit } -repOverloadedLiteral (HsIsString s _ _) = do { lit <- mk_string s; repLiteral lit } +repOverloadedLiteral (OverLit { ol_val = val}) + = do { lit <- mk_lit val; repLiteral lit } -- The type Rational will be in the environment, becuase -- the smart constructor 'TH.Syntax.rationalL' uses it in its type, -- and rationalL is sucked in when any TH stuff is used + +mk_lit :: OverLitVal -> DsM HsLit +mk_lit (HsIntegral i) = mk_integer i +mk_lit (HsFractional f) = mk_rational f +mk_lit (HsIsString s) = mk_string s --------------- Miscellaneous -------------------