git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge pull request #2385 from LiamGoodacre/fix/bind-scope
cfacd20Phil Freeman
examples/warning/2383.pursnew file+12
@@ -0,0 +1,12 @@
1+-- | This specifically shouldn't warn about `x` being shadowed in `main`
2+-- | See https://github.com/purescript/purescript/issues/2383
3+module Main where
4+
5+import Prelude
6+
7+import Control.Monad.Eff (Eff)
8+
9+main :: Eff () Unit
10+main = do
11+ x <- let x = pure unit in x
12+ pure unit
src/Language/PureScript/AST/Traversals.hs+1−1
@@ -551,7 +551,7 @@ everythingWithScope f g h i j = (f'', g'', h'', i'', \s -> snd . j'' s)
551 j' s (DoNotationValue v) = (s, g'' s v)
551 j' s (DoNotationValue v) = (s, g'' s v)
552 j' s (DoNotationBind b v) =
552 j' s (DoNotationBind b v) =
553 let s' = S.union (S.fromList (binderNames b)) s
553 let s' = S.union (S.fromList (binderNames b)) s
554− in (s', h'' s b <> g'' s' v)
554+ in (s', h'' s b <> g'' s v)
555 j' s (DoNotationLet ds) =
555 j' s (DoNotationLet ds) =
556 let s' = S.union s (S.fromList (mapMaybe getDeclIdent ds))
556 let s' = S.union s (S.fromList (mapMaybe getDeclIdent ds))
557 in (s', foldMap (f'' s') ds)
557 in (s', foldMap (f'' s') ds)