From 01eae3351a47d64f5c677bc42c3cff2a5f3acba9 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Fri, 12 Oct 2012 10:22:18 +0200 Subject: [PATCH] Avoid the annoying "y shadowed" GHC warnings --- yesod-routes/Yesod/Routes/TH/Dispatch.hs | 7 +++++-- yesod-routes/yesod-routes.cabal | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/yesod-routes/Yesod/Routes/TH/Dispatch.hs b/yesod-routes/Yesod/Routes/TH/Dispatch.hs index 338d1463..a52f69ad 100644 --- a/yesod-routes/Yesod/Routes/TH/Dispatch.hs +++ b/yesod-routes/Yesod/Routes/TH/Dispatch.hs @@ -203,8 +203,11 @@ routeArg3 runHandler dispatcher fixHandler parents name resPieces resDisp = do Static _ -> return Nothing Dynamic _ -> Just <$> newName "x" - ys <- forM (catMaybes xs) $ \x -> do - y <- newName "y" + -- Note: the zipping with Ints is just a workaround for (apparently) a bug + -- in GHC where the identifiers are considered to be overlapping. Using + -- newName should avoid the problem, but it doesn't. + ys <- forM (zip (catMaybes xs) [1..]) $ \(x, i) -> do + y <- newName $ "y" ++ show (i :: Int) return (x, y) -- In case we have multi pieces at the end diff --git a/yesod-routes/yesod-routes.cabal b/yesod-routes/yesod-routes.cabal index e0c9408c..b49bae42 100644 --- a/yesod-routes/yesod-routes.cabal +++ b/yesod-routes/yesod-routes.cabal @@ -1,5 +1,5 @@ name: yesod-routes -version: 1.1.0.1 +version: 1.1.0.2 license: MIT license-file: LICENSE author: Michael Snoyman