Skip to content

Commit

Permalink
Add (disabled) file demonstrating an error with modules, see issue #14
Browse files Browse the repository at this point in the history
  • Loading branch information
Devon Loehr committed Feb 1, 2022
1 parent 5f46156 commit 6d14edc
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions examples/regression/reg9.dpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* TODO: Enable this test when we've fixed the bug
The bug: The key argument to add_to_struct_count can't actually be 'any, since it's
used as an argument to a memop. But instead of catching this and reporting the error,
the constraint checker gets confused and either reports unknown or unsatisfactory constraints
The fix: Add a check that ensures all parts of the function declaration in interface
are sufficiently general, not just the constraints
memop keyupdate(int<<'a>> memval, int<<'a>> keyval) {
return keyval;
}

module HashTable : {
global type t<<'idx_sz, 'k, 'a>>;

// funs to match bloom and cms
fun void add_to_struct_count(t<<'idx_sz, 'k, 'a>> struct, 'any key) [start <= struct; end struct];
} {
type t<<'idx_sz, 'k, 'a>> = {
Array.t<<'a>> keys;
}

fun void add_to_struct_count(t<<'idx_sz, 'k, 'a>> struct, 'any key) {
Array.update(struct#keys, 0, keyupdate, key, keyupdate, key);
}
}
*/

0 comments on commit 6d14edc

Please sign in to comment.