X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcPat.lhs;h=f2201548d1dab2bea76bab3ab86cb99ef86e54f5;hb=6bd4bdcbb35bb49728a025cf3b4b2a87793dbe8e;hp=fca172f3e39cd68bf6bf0a15c1929c6ac61f3ad8;hpb=e9efdf979386e596394aee9984593d518866fe41;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcPat.lhs b/compiler/typecheck/TcPat.lhs index fca172f..f220154 100644 --- a/compiler/typecheck/TcPat.lhs +++ b/compiler/typecheck/TcPat.lhs @@ -717,9 +717,10 @@ tcConArgs data_con arg_tys (PrefixCon arg_pats) pstate thing_inside con_arity = dataConSourceArity data_con no_of_args = length arg_pats -tcConArgs data_con [arg_ty1,arg_ty2] (InfixCon p1 p2) pstate thing_inside +tcConArgs data_con arg_tys (InfixCon p1 p2) pstate thing_inside = do { checkTc (con_arity == 2) -- Check correct arity (arityErr "Constructor" data_con con_arity 2) + ; let [arg_ty1,arg_ty2] = arg_tys -- This can't fail after the arity check ; ([p1',p2'], tvs, res) <- tcMultiple tcConArg [(p1,arg_ty1),(p2,arg_ty2)] pstate thing_inside ; return (InfixCon p1' p2', tvs, res) }