on master help sign in
Update tests: primes are no longer allowed in variable names
commit9f4d479b48a4a4de2690cb7a2f519260d5f06170 authorEvan Czaplicki <evancz@users.noreply.github.com> dateWed 7 Dec 2016, 15:23 (10 years ago) parent8491fae
2 files changed−28
tests/test-files/good/CodeGenBugs/TailRecursion_NameNormalization.elm−8 tests/test-files/good/CodeGenBugs/TailRecursion_UnsafeLabel.elm−20
tests/test-files/good/CodeGenBugs/TailRecursion_NameNormalization.elmdeleted−8
@@ -1,8 +0,0 @@
1−-- From https://github.com/elm-lang/elm-compiler/issues/1226
2−--
3−-- When code can be tail call optimized, one of the arguments turns into
4−-- the loop variable. Its name must be properly normalized, for example,
5−-- to avoid primes.
6−
7−go n' = if n' then go n' else False
8−
tests/test-files/good/CodeGenBugs/TailRecursion_UnsafeLabel.elmdeleted−20
@@ -1,20 +0,0 @@
1−-- From https://github.com/elm-lang/elm-compiler/issues/1104
2−--
3−-- When code can be tail call optimized, we use the name of the function as
4−-- the label. The label must be a safe name, not a raw thing. Otherwise it
5−-- could have primes in it!
6−
7−
8−type List a
9− = Nil
10− | Cons a (List a)
11−
12−
13−foldl' : (a -> b -> b) -> b -> List a -> b
14−foldl' update state items =
15− case items of
16− Nil ->
17− state
18−
19− Cons item rest ->
20− foldl' update (update item state) rest