From: ross Date: Fri, 12 Mar 2004 21:37:27 +0000 (+0000) Subject: [project @ 2004-03-12 21:37:27 by ross] X-Git-Tag: Approx_11550_changesets_converted~1 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=13c52eb2df2627f2b316a79e0fad8f3f5feeeb21;p=ghc-hetmet.git [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 --- 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} %************************************************************************