diff options
author | Hécate <hecate+gitlab@glitchbra.in> | 2020-10-10 21:15:36 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-11-01 01:11:09 -0400 |
commit | dfd27445308d1ed2df8826c2a045130e918e8192 (patch) | |
tree | 99fc01edeebc2924ddb7533864e0d4ca18cfe800 /compiler/GHC/HsToCore/Match | |
parent | bd4abdc953427e084e7ecba89db64860f6859822 (diff) | |
download | haskell-dfd27445308d1ed2df8826c2a045130e918e8192.tar.gz |
Add the proper HLint rules and remove redundant keywords from compiler
Diffstat (limited to 'compiler/GHC/HsToCore/Match')
-rw-r--r-- | compiler/GHC/HsToCore/Match/Literal.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/GHC/HsToCore/Match/Literal.hs b/compiler/GHC/HsToCore/Match/Literal.hs index 70acb36724..7cf9f2e483 100644 --- a/compiler/GHC/HsToCore/Match/Literal.hs +++ b/compiler/GHC/HsToCore/Match/Literal.hs @@ -105,7 +105,7 @@ dsLit l = do HsString _ str -> mkStringExprFS str HsInteger _ i _ -> return (mkIntegerExpr i) HsInt _ i -> return (mkIntExpr platform (il_value i)) - HsRat _ (FL _ _ val) ty -> do + HsRat _ (FL _ _ val) ty -> return (mkCoreConApps ratio_data_con [Type integer_ty, num, denom]) where num = mkIntegerExpr (numerator val) @@ -223,7 +223,7 @@ warnAboutOverflowedLiterals dflags lit checkPositive :: Integer -> Name -> DsM () checkPositive i tc - = when (i < 0) $ do + = when (i < 0) $ warnDs (Reason Opt_WarnOverflowedLiterals) (vcat [ text "Literal" <+> integer i <+> text "is negative but" <+> ppr tc @@ -232,7 +232,7 @@ warnAboutOverflowedLiterals dflags lit check :: forall a. (Bounded a, Integral a) => Integer -> Name -> Proxy a -> DsM () check i tc _proxy - = when (i < minB || i > maxB) $ do + = when (i < minB || i > maxB) $ warnDs (Reason Opt_WarnOverflowedLiterals) (vcat [ text "Literal" <+> integer i <+> text "is out of the" <+> ppr tc <+> ptext (sLit "range") |