diff --git a/src/Parse/Expression.hs b/src/Parse/Expression.hs index 3230e42ff..26f95f6ba 100644 --- a/src/Parse/Expression.hs +++ b/src/Parse/Expression.hs @@ -489,11 +489,11 @@ let_ start = letHelp :: R.Position -> Int -> [Src.RawDef] -> R.Position -> SPos -> ExprParser -letHelp start oldIndent defs end pos = +letHelp start oldIndent revDefs end pos = oneOf [ do checkAligned pos (def, newEnd, newPos) <- definition - letHelp start oldIndent (def:defs) newEnd newPos + letHelp start oldIndent (def:revDefs) newEnd newPos , do setIndent oldIndent checkSpace pos @@ -501,7 +501,7 @@ letHelp start oldIndent defs end pos = popContext () spaces (body, newEnd, newPos) <- expression - let letExpr = A.at start end (Src.Let defs body) + let letExpr = A.at start end (Src.Let (reverse revDefs) body) return ( letExpr, newEnd, newPos ) ] diff --git a/tests/test-files/good-expected-js/Records/NonHomogeneousRecords.elm.js b/tests/test-files/good-expected-js/Records/NonHomogeneousRecords.elm.js index f7c4d1adc..d1a9bc2e9 100644 --- a/tests/test-files/good-expected-js/Records/NonHomogeneousRecords.elm.js +++ b/tests/test-files/good-expected-js/Records/NonHomogeneousRecords.elm.js @@ -1,6 +1,6 @@ var _elm_lang$core$Main$bindFields = function (thing) { - var x = thing.x; var y = thing.y; + var x = thing.x; return thing; }; var _elm_lang$core$Main$Thing = F2( diff --git a/tests/test-files/good-expected-js/Soundness/IdAnnotated.elm.js b/tests/test-files/good-expected-js/Soundness/IdAnnotated.elm.js new file mode 100644 index 000000000..adc073625 --- /dev/null +++ b/tests/test-files/good-expected-js/Soundness/IdAnnotated.elm.js @@ -0,0 +1,6 @@ +var _elm_lang$core$Main$myId = function () { + var id = function (x) { + return x; + }; + return id; +}();