git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix scope traversal for do-notation bind.
commit92f91110d7be728e712a7779e0e4f79b50f63043 authorLiam Goodacre <goodacre.liam@gmail.com> dateTue 11 Oct 2016, 07:49 (10 years ago) parent32220ee
2 files changed+13−1
examples/warning/2383.purs+12 src/Language/PureScript/AST/Traversals.hs+1−1
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)
551551 j' s (DoNotationValue v) = (s, g'' s v)
552552 j' s (DoNotationBind b v) =
553553 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)
555555 j' s (DoNotationLet ds) =
556556 let s' = S.union s (S.fromList (mapMaybe getDeclIdent ds))
557557 in (s', foldMap (f'' s') ds)