Errors talking about a left section should refer to the "first" argument
authorIan Lynagh <igloo@earth.li>
Thu, 24 Sep 2009 12:41:28 +0000 (12:41 +0000)
committerIan Lynagh <igloo@earth.li>
Thu, 24 Sep 2009 12:41:28 +0000 (12:41 +0000)
rather than the "second" argument. Fixes trac #3505.

compiler/typecheck/TcExpr.lhs

index 4ccd89c..98942a4 100644 (file)
@@ -261,7 +261,7 @@ tcExpr in_expr@(SectionL arg1 lop@(L loc op)) res_ty
                <+> ptext (sLit "takes one argument")
     tc_args arg2_ty' qtvs qtys [arg1_ty, arg2_ty] 
        = do { boxyUnify arg2_ty' (substTyWith qtvs qtys arg2_ty)
-            ; arg1' <- tcArg lop 2 arg1 qtvs qtys arg1_ty 
+            ; arg1' <- tcArg lop 1 arg1 qtvs qtys arg1_ty
             ; qtys' <- mapM refineBox qtys     -- c.f. tcArgs 
             ; return (qtys', arg1') }
     tc_args _ _ _ _ = panic "tcExpr SectionL"