2011-05-27 19:01:08 -05:00
|
|
|
// error-pattern: mismatched types
|
|
|
|
use std;
|
|
|
|
import std::map::hashmap;
|
|
|
|
import std::bitv;
|
|
|
|
|
2011-08-10 11:27:22 -05:00
|
|
|
type fn_info = {vars: hashmap<uint, var_info>};
|
2011-07-27 07:19:39 -05:00
|
|
|
type var_info = {a: uint, b: uint};
|
2011-05-27 19:01:08 -05:00
|
|
|
|
2011-07-27 07:19:39 -05:00
|
|
|
fn bitv_to_str(enclosing: fn_info, v: bitv::t) -> str {
|
|
|
|
let s = "";
|
2011-05-27 19:01:08 -05:00
|
|
|
|
2011-07-27 07:19:39 -05:00
|
|
|
// error is that the value type in the hash map is var_info, not a box
|
2011-10-21 06:14:28 -05:00
|
|
|
enclosing.vars.values {|val|
|
|
|
|
if bitv::get(v, val) { s += "foo"; }
|
2011-10-21 07:12:12 -05:00
|
|
|
}
|
2011-07-27 07:19:39 -05:00
|
|
|
ret s;
|
2011-05-27 19:01:08 -05:00
|
|
|
}
|
|
|
|
|
2011-12-22 16:42:52 -06:00
|
|
|
fn main() { #debug("OK"); }
|