From 13c52eb2df2627f2b316a79e0fad8f3f5feeeb21 Mon Sep 17 00:00:00 2001 From: ross Date: Fri, 12 Mar 2004 21:37:27 +0000 Subject: [PATCH] [project @ 2004-03-12 21:37:27 by ross] Deal gracefully with arrow commands where an expression is expected, instead of panicking. (Bug reported by Isaac Jones) merge to STABLE --- ghc/compiler/typecheck/TcExpr.lhs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ghc/compiler/typecheck/TcExpr.lhs b/ghc/compiler/typecheck/TcExpr.lhs index 1714a33..d0328f9 100644 --- a/ghc/compiler/typecheck/TcExpr.lhs +++ b/ghc/compiler/typecheck/TcExpr.lhs @@ -327,6 +327,14 @@ tc_expr (ExplicitTuple exprs boxity) res_ty tc_expr (HsProc pat cmd) res_ty = tcProc pat cmd res_ty `thenM` \ (pat', cmd') -> returnM (HsProc pat' cmd') + +tc_expr e@(HsArrApp _ _ _ _ _) _ + = failWithTc (vcat [ptext SLIT("The arrow command"), nest 2 (ppr e), + ptext SLIT("was found where an expression was expected")]) + +tc_expr e@(HsArrForm _ _ _) _ + = failWithTc (vcat [ptext SLIT("The arrow command"), nest 2 (ppr e), + ptext SLIT("was found where an expression was expected")]) \end{code} %************************************************************************ -- 1.7.10.4