From 751ad4098768569450306b7e269081bbac81ea71 Mon Sep 17 00:00:00 2001 From: SimonBoulier Date: Tue, 7 Jan 2020 10:07:08 +0100 Subject: Turn trailing implicit warning into an error --- interp/impargs.ml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'interp') diff --git a/interp/impargs.ml b/interp/impargs.ml index df28b32f81..b22407c2b7 100644 --- a/interp/impargs.ml +++ b/interp/impargs.ml @@ -648,9 +648,8 @@ let maybe_declare_manual_implicits local ref ?enriching l = (* TODO: either turn these warnings on and document them, or handle these cases sensibly *) -let warn_set_maximal_deprecated = - CWarnings.create ~name:"set-maximal-deprecated" ~category:"deprecated" - (fun i -> strbrk ("Argument number " ^ string_of_int i ^ " is a trailing implicit so must be maximal")) +let msg_trailing_implicit id = + user_err (strbrk ("Argument " ^ Names.Id.to_string id ^ " is a trailing implicit, so it can't be declared non maximal. Please use { } instead of [ ].")) type implicit_kind = Implicit | MaximallyImplicit | NotImplicit @@ -662,7 +661,7 @@ let compute_implicit_statuses autoimps l = | Name id :: autoimps, Implicit :: manualimps -> let imps' = aux (i+1) (autoimps, manualimps) in let max = set_maximality imps' false in - if max then warn_set_maximal_deprecated i; + if max then msg_trailing_implicit id; Some (ExplByName id, Manual, (max, true)) :: imps' | Anonymous :: _, (Implicit | MaximallyImplicit) :: _ -> user_err ~hdr:"set_implicits" -- cgit v1.2.3