From 883a8fc6a85243015937ae93c3f569f82582c93e Mon Sep 17 00:00:00 2001 From: simonpj Date: Thu, 23 May 2002 15:37:32 +0000 Subject: [PATCH 1/1] [project @ 2002-05-23 15:37:32 by simonpj] Reject type arguments gracefully --- 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 52ec896..e6a3d85 100644 --- a/ghc/compiler/typecheck/TcExpr.lhs +++ b/ghc/compiler/typecheck/TcExpr.lhs @@ -147,6 +147,14 @@ tcMonoExpr in_expr@(ExprWithTySig expr poly_ty) res_ty tcSubExp res_ty inst_sig_ty `thenTc` \ (co_fn, lie3) -> returnTc (co_fn <$> inst_fn expr', lie1 `plusLIE` lie2 `plusLIE` lie3) + +tcMonoExpr (HsType ty) res_ty + = failWithTc (text "Can't handle type argument:" <+> ppr ty) + -- This is the syntax for type applications that I was planning + -- but there are difficulties (e.g. what order for type args) + -- so it's not enabled yet. + -- Can't eliminate it altogether from the parser, because the + -- same parser parses *patterns*. \end{code} -- 1.7.10.4