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-08-15 23:54:52 -05:00
|
|
|
for each p: @{key: uint, val: @uint} in enclosing.vars.items() {
|
2011-07-27 07:19:39 -05:00
|
|
|
if bitv::get(v, *p.val) { s += "foo"; }
|
2011-05-27 19:01:08 -05:00
|
|
|
}
|
2011-07-27 07:19:39 -05:00
|
|
|
ret s;
|
2011-05-27 19:01:08 -05:00
|
|
|
}
|
|
|
|
|
2011-08-15 23:54:52 -05:00
|
|
|
fn main() { log "OK"; }
|