diff options
| author | Christopher Pulte | 2019-03-04 14:37:14 +0000 |
|---|---|---|
| committer | Christopher Pulte | 2019-03-04 14:37:14 +0000 |
| commit | fff4aa0da575c6c4ce6808218d14cda90bc66f01 (patch) | |
| tree | 6e022bf77f52b5fc269c178ad4bc3451fcf8a799 /src/pattern_completeness.ml | |
| parent | 191763ccfe4cc020236174ce9388c06d9c6d5b3c (diff) | |
| parent | 9ed89583d52ccff151fb75424975f2ac4e627a1b (diff) | |
Merge branch 'sail2' of https://github.com/rems-project/sail into sail2
Diffstat (limited to 'src/pattern_completeness.ml')
| -rw-r--r-- | src/pattern_completeness.ml | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pattern_completeness.ml b/src/pattern_completeness.ml index 514eb5c0..79fc93ee 100644 --- a/src/pattern_completeness.ml +++ b/src/pattern_completeness.ml @@ -89,7 +89,7 @@ let is_wild = function | GP_wild -> true | _ -> false -let rec generalize ctx (P_aux (p_aux, _) as pat) = +let rec generalize ctx (P_aux (p_aux, (l, _)) as pat) = match p_aux with | P_lit (L_aux (L_unit, _)) -> (* Unit pattern always matches on unit, so generalize to wildcard *) @@ -105,7 +105,8 @@ let rec generalize ctx (P_aux (p_aux, _) as pat) = match ctx.lookup_id id with | Unbound -> GP_wild | Local (Immutable, _) -> GP_wild - | Register _ | Local (Mutable, _) -> Util.warn "Matching on register or mutable variable"; GP_wild + | Register _ | Local (Mutable, _) -> + Util.warn ("Matching on register or mutable variable at " ^ Reporting.loc_to_string l); GP_wild | Enum _ -> GP_app (Bindings.singleton id GP_wild) end | P_var (pat, _) -> generalize ctx pat |
