Skip to content

Commit 293b34d

Browse files
committed
add test case for name normalization in tail call optimization
1 parent 871b1f1 commit 293b34d

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Elm.Main = Elm.Main || {};
2+
Elm.Main.make = function (_elm) {
3+
"use strict";
4+
_elm.Main = _elm.Main || {};
5+
if (_elm.Main.values) return _elm.Main.values;
6+
var _U = Elm.Native.Utils.make(_elm);
7+
var _op = {};
8+
var go = function (n$) { go: while (true) if (n$) { var _v0 = n$;n$ = _v0;continue go;} else return false;};
9+
return _elm.Main.values = {_op: _op,go: go};
10+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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+

0 commit comments

Comments
 (0)