X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcHsSyn.lhs;h=2a17fe8a4e1f6c9a2e7bb2ecf593cfa70e2a2dfd;hp=cd2cadf0854870dba8bea5e03b4c22c0ddecd41b;hb=3391a03562d4056de7b16cd0f632e6c43ae44cca;hpb=ee5addccd1929a7368a39b2c88d1b77f0bc8fb73 diff --git a/compiler/typecheck/TcHsSyn.lhs b/compiler/typecheck/TcHsSyn.lhs index cd2cadf..2a17fe8 100644 --- a/compiler/typecheck/TcHsSyn.lhs +++ b/compiler/typecheck/TcHsSyn.lhs @@ -121,7 +121,7 @@ shortCutLit (HsIntegral i) ty | isIntTy ty && inIntRange i = Just (HsLit (HsInt i)) | isWordTy ty && inWordRange i = Just (mkLit wordDataCon (HsWordPrim i)) | isIntegerTy ty = Just (HsLit (HsInteger i ty)) - | otherwise = shortCutLit (HsFractional (fromInteger i)) ty + | otherwise = shortCutLit (HsFractional (FL { fl_text = show i, fl_value = fromInteger i })) ty -- The 'otherwise' case is important -- Consider (3 :: Float). Syntactically it looks like an IntLit, -- so we'll call shortCutIntLit, but of course it's a float @@ -129,8 +129,8 @@ shortCutLit (HsIntegral i) ty -- literals, compiled without -O shortCutLit (HsFractional f) ty - | isFloatTy ty = Just (mkLit floatDataCon (HsFloatPrim f)) - | isDoubleTy ty = Just (mkLit doubleDataCon (HsDoublePrim f)) + | isFloatTy ty = Just (mkLit floatDataCon (HsFloatPrim (fl_value f))) + | isDoubleTy ty = Just (mkLit doubleDataCon (HsDoublePrim (fl_value f))) | otherwise = Nothing shortCutLit (HsIsString s) ty