Test for accidental renamer ident shadowing
commit58091f4c626dc159c76f9abe2695ae275bde5434
authorGary Burgess <gary.burgess@gmail.com>
dateSun 3 Aug 2014, 21:30 (12 years ago)
parent756407e
examples/passing/ShadowedRename.pursnew file+19
@@ -0,0 +1,19 @@
1+module Main where
2+
3+import Control.Monad.Eff
4+import Debug.Trace
5+
6+foreign import f
7+ "function f(x) {\
8+ \ return function () {\
9+ \ if (x !== 2) throw new Error('x is not 2');\
10+ \ }\
11+ \}" :: forall e. Number -> Eff e Number
12+
13+foo foo = let foo_1 = \_ -> foo
14+ foo_2 = foo_1 unit + 1
15+ in foo_2
16+
17+main = do
18+ f (foo 1)
19+ trace "Done"