mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-08 04:56:58 +00:00
Look at the type params of an item_ty when resolving.
This commit is contained in:
parent
d313e1579b
commit
35d53b7eb1
@ -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 \
|
||||
|
@ -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);
|
||||
|
5
src/test/run-pass/type-param.rs
Normal file
5
src/test/run-pass/type-param.rs
Normal file
@ -0,0 +1,5 @@
|
||||
type lteq[T] = fn(&T a) -> bool;
|
||||
|
||||
fn main(vec[str] args) {
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user