Skip to content

Commit

Permalink
Add mapping compleness check test case
Browse files Browse the repository at this point in the history
  • Loading branch information
trdthg committed Jul 27, 2024
1 parent 6272baf commit 78a0c43
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/effects.ml
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,9 @@ let infer_def_direct_effects asserts_termination def =
effects := EffectSet.add IncompleteMatch !effects
| None -> Reporting.unreachable l __POS__ "Empty funcls in infer_def_direct_effects"
end
| DEF_aux (DEF_mapdef _, _) -> effects := EffectSet.add IncompleteMatch !effects
| DEF_aux (DEF_mapdef _, def_annot) ->
if Option.is_some (get_def_attribute "incomplete" def_annot) then
effects := EffectSet.add IncompleteMatch !effects
| DEF_aux (DEF_scattered _, _) -> effects := EffectSet.add Scattered !effects
| _ -> ()
end;
Expand Down
10 changes: 10 additions & 0 deletions test/pattern_completeness/mapping_let.sail
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
struct bool2 = {
field: bool,
}

mapping m : bool <-> bool2 = {
true <-> struct { field = true },
false <-> struct{ field = false },
}

let a = m(true)

0 comments on commit 78a0c43

Please sign in to comment.