[commit: ghc] wip/impredicativity: Fix bug in SectionL handling (b55fbe0)

git at git.haskell.org git at git.haskell.org
Tue Jul 14 07:43:00 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/impredicativity
Link       : http://ghc.haskell.org/trac/ghc/changeset/b55fbe02a6a887481a8707e86aed3cab92550c3d/ghc

>---------------------------------------------------------------

commit b55fbe02a6a887481a8707e86aed3cab92550c3d
Author: Alejandro Serrano <trupill at gmail.com>
Date:   Tue Jul 14 09:43:49 2015 +0200

    Fix bug in SectionL handling


>---------------------------------------------------------------

b55fbe02a6a887481a8707e86aed3cab92550c3d
 compiler/typecheck/TcExpr.hs | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/compiler/typecheck/TcExpr.hs b/compiler/typecheck/TcExpr.hs
index 5ddfed9..a52a81e 100644
--- a/compiler/typecheck/TcExpr.hs
+++ b/compiler/typecheck/TcExpr.hs
@@ -288,11 +288,12 @@ tcExpr app@(OpApp _ _ _ _) res_ty = tcApp app res_ty
 
 tcExpr (SectionL arg1 op) res_ty
   = do { dflags <- getDynFlags      -- Note [Left sections]
-       ; let n_reqd_args | xopt Opt_PostfixOperators dflags = 1
-                         | otherwise                        = 2
-       ; (co_fun, args_tys@(arg1_ty : _), rest_ty) <-
+       ; let n_reqd_args | xopt Opt_PostfixOperators dflags = 0
+                         | otherwise                        = 1
+       ; (co_fun, args_tys, rest_ty) <-
            matchExpectedFunTys (mk_app_msg op) n_reqd_args res_ty
-       ; let op_ty = mkFunTys args_tys rest_ty
+       ; arg1_ty <- newFlexiTyVarTy openTypeKind
+       ; let op_ty = mkFunTys (arg1_ty:args_tys) rest_ty
           -- typecheck op and arg1
        ; op'   <- tcPolyMonoExprNC op op_ty
        ; arg1' <- tcArg op' (arg1, arg1_ty, 1)



More information about the ghc-commits mailing list