Commit 6ee15d31 authored by Ross Paterson's avatar Ross Paterson
Browse files

fix extraction of command stack of arguments of arrow "forms" (fixes #4236)

The command stack was being extracted (by unscramble) with the outermost
type first, contrary to the comment on the function.
parent 34bb2bb9
......@@ -294,14 +294,13 @@ tc_cmd env cmd@(HsArrForm expr fixity cmd_args) (cmd_stk, res_ty)
unscramble :: TcType -> (TcType, [TcType])
-- unscramble ((w,s1) .. sn) = (w, [s1..sn])
unscramble ty
unscramble ty = unscramble' ty []
unscramble' ty ss
= case tcSplitTyConApp_maybe ty of
Just (tc, [t,s]) | tc == pairTyCon
-> let
(w,ss) = unscramble t
in (w, s:ss)
_ -> (ty, [])
-> unscramble' t (s:ss)
_ -> (ty, ss)
-----------------------------------------------------------------
-- Base case for illegal commands
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment