Add some more explanation to @laszlopandy's addition from #1086
commit05a0c164c93e080e0172e8c27eb05a48d5c7964e
authorEvan Czaplicki <info@elm-lang.org>
dateFri 9 Oct 2015, 16:18 (11 years ago)
parent176fac8
tests/test-files/good/CodeGenBugs/Shadowing.elm+13−9
@@ -1,18 +1,22 @@
1+-- From: https://github.com/elm-lang/elm-compiler/issues/1086
2+--
3+-- Problem is that the `a` in (Second a b) shadowed the argument to `toName`,
4+-- actually overwriting the value.
15
2−{- From: https://github.com/elm-lang/elm-compiler/issues/1086 -}
36
47type AType
58 = First
69 | Second String String
710
11+
812toName : AType -> String
913toName a =
10− let name =
11− case a of
12− First ->
13− "True"
14+ let name =
15+ case a of
16+ First ->
17+ "True"
1418
15− Second a b ->
16− a
17− in
18− name
19+ Second a b ->
20+ a
21+ in
22+ name