summaryrefslogtreecommitdiff
path: root/src/rewrites.ml
diff options
context:
space:
mode:
authorJon French2018-11-01 15:58:08 +0000
committerJon French2018-11-01 15:58:08 +0000
commit6bab4056ba7cd10e0dc633187b74b24a73bdd259 (patch)
tree9d9b6fb1f26122b6fa1a1a86359737c928b9991b /src/rewrites.ml
parentd47313c00011be39ed1c2e411d401bb759ed65bf (diff)
parent29f69b03602552d3ca1a29713527d21f5790e28a (diff)
Merge branch 'sail2' into rmem_interpreter
Diffstat (limited to 'src/rewrites.ml')
-rw-r--r--src/rewrites.ml11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/rewrites.ml b/src/rewrites.ml
index cdb15717..c470d906 100644
--- a/src/rewrites.ml
+++ b/src/rewrites.ml
@@ -4595,7 +4595,16 @@ let rec remove_clause_from_pattern ctx (P_aux (rm_pat,ann)) res_pat =
(match res_pat with
| RP_app (id',residual_args) ->
if Id.compare id id' == 0 then
- let res_pats' = subpats args residual_args in
+ let res_pats' =
+ (* Constructors that were specified without a return type might get
+ an extra tuple in their type; expand that here if necessary.
+ TODO: this should go away if we enforce proper arities. *)
+ match args, residual_args with
+ | [], [RP_any]
+ | _::_::_, [RP_any]
+ -> subpats args (List.map (fun _ -> RP_any) args)
+ | _,_ ->
+ subpats args residual_args in
List.map (fun rps -> RP_app (id,rps)) res_pats'
else [res_pat]
| RP_any ->