Commit 9864edf2 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Look through tick-boxes when looking for integral literals in the desugarer

Fixes Trac #8334
parent b84fbabb
...@@ -213,11 +213,16 @@ warnAboutEmptyEnumerations dflags fromExpr mThnExpr toExpr ...@@ -213,11 +213,16 @@ warnAboutEmptyEnumerations dflags fromExpr mThnExpr toExpr
| otherwise = return () | otherwise = return ()
getLHsIntegralLit :: LHsExpr Id -> Maybe (Integer, Name) getLHsIntegralLit :: LHsExpr Id -> Maybe (Integer, Name)
-- See if the expression is an Integral literal
-- Remember to look through automatically-added tick-boxes! (Trac #8384)
getLHsIntegralLit (L _ (HsPar e)) = getLHsIntegralLit e
getLHsIntegralLit (L _ (HsTick _ e)) = getLHsIntegralLit e
getLHsIntegralLit (L _ (HsBinTick _ _ e)) = getLHsIntegralLit e
getLHsIntegralLit (L _ (HsOverLit over_lit)) = getIntegralLit over_lit getLHsIntegralLit (L _ (HsOverLit over_lit)) = getIntegralLit over_lit
getLHsIntegralLit _ = Nothing getLHsIntegralLit _ = Nothing
getIntegralLit :: HsOverLit Id -> Maybe (Integer, Name) getIntegralLit :: HsOverLit Id -> Maybe (Integer, Name)
getIntegralLit (OverLit { ol_val = HsIntegral i, ol_type = ty }) getIntegralLit (OverLit { ol_val = HsIntegral i, ol_type = ty })
| Just tc <- tyConAppTyCon_maybe ty | Just tc <- tyConAppTyCon_maybe ty
= Just (i, tyConName tc) = Just (i, tyConName tc)
getIntegralLit _ = Nothing getIntegralLit _ = Nothing
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment