2011-05-27 17:01:08 -07:00
|
|
|
// error-pattern: mismatched types
|
|
|
|
use std;
|
|
|
|
import std::map::hashmap;
|
|
|
|
import std::bitv;
|
|
|
|
|
2011-08-10 09:27:22 -07:00
|
|
|
type fn_info = {vars: hashmap<uint, var_info>};
|
2011-07-27 14:19:39 +02:00
|
|
|
type var_info = {a: uint, b: uint};
|
2011-05-27 17:01:08 -07:00
|
|
|
|
2011-07-27 14:19:39 +02:00
|
|
|
fn bitv_to_str(enclosing: fn_info, v: bitv::t) -> str {
|
|
|
|
let s = "";
|
2011-05-27 17:01:08 -07:00
|
|
|
|
2011-07-27 14:19:39 +02:00
|
|
|
// error is that the value type in the hash map is var_info, not a box
|
2011-08-15 21:54:52 -07:00
|
|
|
for each p: @{key: uint, val: @uint} in enclosing.vars.items() {
|
2011-07-27 14:19:39 +02:00
|
|
|
if bitv::get(v, *p.val) { s += "foo"; }
|
2011-05-27 17:01:08 -07:00
|
|
|
}
|
2011-07-27 14:19:39 +02:00
|
|
|
ret s;
|
2011-05-27 17:01:08 -07:00
|
|
|
}
|
|
|
|
|
2011-08-15 21:54:52 -07:00
|
|
|
fn main() { log "OK"; }
|