2011-05-27 17:01:08 -07:00
|
|
|
// error-pattern: mismatched types
|
|
|
|
use std;
|
|
|
|
import std::map::hashmap;
|
|
|
|
import std::bitv;
|
|
|
|
|
|
|
|
type fn_info = rec(hashmap[uint, var_info] vars);
|
|
|
|
type var_info = rec(uint a, uint b);
|
|
|
|
|
|
|
|
fn bitv_to_str(fn_info enclosing, bitv::t v) -> str {
|
|
|
|
auto s = "";
|
|
|
|
|
2011-07-26 14:49:40 +02:00
|
|
|
// error is that the value type in the hash map is var_info, not a box
|
|
|
|
for each (@rec(uint key, @uint val) p
|
|
|
|
in enclosing.vars.items()) {
|
|
|
|
if (bitv::get(v, *p.val)) {
|
2011-06-14 15:11:35 -07:00
|
|
|
s += "foo";
|
2011-05-27 17:01:08 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
ret s;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
log "OK";
|
|
|
|
}
|