on master help sign in
Merge pull request #259 from maxsnew/dev

Fix Function Application Code Generation Bug for >=10 Arguments

commit811594dbc5fac619a4508ab00cfb0209818a63f6 authorEvan Czaplicki <info@elm-lang.org> dateTue 17 Sep 2013, 07:54 (13 years ago) parentd94e2183783f26
1 file changed+2−1
compiler/Generate/JavaScript.hs+2−1
compiler/Generate/JavaScript.hs+2−1
@@ -140,7 +140,8 @@ expression (L span expr) =
140140 args' <- mapM expression args
141141 return $ case args' of
142142 [arg] -> func' <| arg
143− _ -> ref aN `call` (func':args')
143+ _ | length args' <= 9 -> ref aN `call` (func':args')
144+ | otherwise -> foldl1 (<|) (func':args')
144145 where
145146 aN = "A" ++ show (length args)
146147 (func, args) = getArgs e1 [e2]