[project @ 2002-05-23 15:37:32 by simonpj]
authorsimonpj <unknown>
Thu, 23 May 2002 15:37:32 +0000 (15:37 +0000)
committersimonpj <unknown>
Thu, 23 May 2002 15:37:32 +0000 (15:37 +0000)
Reject type arguments gracefully

ghc/compiler/typecheck/TcExpr.lhs

index 52ec896..e6a3d85 100644 (file)
@@ -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}