diff options
| author | Jon French | 2019-03-04 14:23:55 +0000 |
|---|---|---|
| committer | Jon French | 2019-03-04 14:23:55 +0000 |
| commit | 94d40fb68bb3d36159a006b93909fc3841c92d28 (patch) | |
| tree | 219c6d0ae7daf47cd6c8897895d182916e8f3815 /src/pattern_completeness.ml | |
| parent | a7a3402ce155f13234d2d3e5198e5dbf6e0e8b82 (diff) | |
| parent | 9ed89583d52ccff151fb75424975f2ac4e627a1b (diff) | |
Merge branch 'sail2' into rmem_interpreter
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 |
