Look at the type params of an item_ty when resolving.

This commit is contained in:
Rafael Ávila de Espíndola 2011-01-19 16:13:33 -05:00
parent d313e1579b
commit 35d53b7eb1
3 changed files with 14 additions and 1 deletions

View File

@ -468,6 +468,7 @@ TEST_XFAILS_RUSTC := $(filter-out \
simple-obj.rs \
stateful-obj.rs \
type-in-nested-module.rs \
type-param.rs \
tup.rs \
u32-decr.rs \
u8-incr.rs \

View File

@ -305,6 +305,14 @@ fn lookup_name_wrapped(&env e, ast.ident i) -> option.t[tup(@env, def_wrap)] {
case (ast.item_mod(_, ?m, _)) {
ret check_mod(i, m);
}
case (ast.item_ty(_, _, ?ty_params, _, _)) {
for (ast.ty_param tp in ty_params) {
if (_str.eq(tp.ident, i)) {
auto t = ast.def_ty_arg(tp.id);
ret some(def_wrap_other(t));
}
}
}
case (_) { /* fall through */ }
}
}
@ -448,7 +456,6 @@ fn fold_view_item_import(&env e, &span sp,
target_def));
}
fn fold_ty_path(&env e, &span sp, ast.path p, &option.t[def] d) -> @ast.ty {
let uint len = _vec.len[ast.ident](p.node.idents);

View File

@ -0,0 +1,5 @@
type lteq[T] = fn(&T a) -> bool;
fn main(vec[str] args) {
}