[commit: ghc] master: Look through tick-boxes when looking for integral literals in the desugarer (9864edf)

git at git.haskell.org git
Thu Oct 3 08:25:57 UTC 2013


Repository : ssh://git at git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/9864edf2557d7a52a4c3d8cccfe1e9e12bf26ebf/ghc

>---------------------------------------------------------------

commit 9864edf2557d7a52a4c3d8cccfe1e9e12bf26ebf
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed Oct 2 13:49:23 2013 +0100

    Look through tick-boxes when looking for integral literals in the desugarer
    
    Fixes Trac #8334


>---------------------------------------------------------------

9864edf2557d7a52a4c3d8cccfe1e9e12bf26ebf
 compiler/deSugar/MatchLit.lhs |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/compiler/deSugar/MatchLit.lhs b/compiler/deSugar/MatchLit.lhs
index d79cfcc..f4c9465 100644
--- a/compiler/deSugar/MatchLit.lhs
+++ b/compiler/deSugar/MatchLit.lhs
@@ -213,6 +213,11 @@ warnAboutEmptyEnumerations dflags fromExpr mThnExpr toExpr
   | otherwise = return ()
 
 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 _ = Nothing
 




More information about the ghc-commits mailing list