diff options
| author | Hugo Herbelin | 2017-04-02 15:53:14 +0200 |
|---|---|---|
| committer | Hugo Herbelin | 2017-04-09 11:52:17 +0200 |
| commit | 70930579d8454a4ff50ee0ea1e97a55863bf01f6 (patch) | |
| tree | a944648db2762f53f70f6b4d935942131afa80cc | |
| parent | 1a43fda0dc9bb8d100808426980446353f8f1ae3 (diff) | |
More explicit message when a {struct x} argument refers to a local definition.
| -rw-r--r-- | interp/topconstr.ml | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/interp/topconstr.ml b/interp/topconstr.ml index 89e04b69d2..513fa8f161 100644 --- a/interp/topconstr.ml +++ b/interp/topconstr.ml @@ -176,7 +176,12 @@ let split_at_annot bl na = in (List.rev ans, CLocalAssum (r, k, t) :: rest) end - | CLocalDef _ as x :: rest -> aux (x :: acc) rest + | CLocalDef ((_,na),_,_) as x :: rest -> + if Name.equal (Name id) na then + user_err ~loc + (Nameops.pr_id id ++ str" must be a proper parameter and not a local definition.") + else + aux (x :: acc) rest | CLocalPattern (loc,_,_) :: rest -> Loc.raise ~loc (Stream.Error "pattern with quote not allowed after fix") | [] -> |
