提交 bc9db2e9 编写于 作者: G Graydon Hoare

Teach resolve to find obj fields and ty params from methods.

上级 a9d03dd1
......@@ -115,6 +115,18 @@ fn in_scope(ast.ident i, &scope s) -> option.t[def] {
}
}
}
case (ast.item_obj(_, ?ob, ?ty_params, _, _)) {
for (ast.obj_field f in ob.fields) {
if (_str.eq(f.ident, i)) {
ret some[def](ast.def_obj_field(f.id));
}
}
for (ast.ty_param tp in ty_params) {
if (_str.eq(tp.ident, i)) {
ret some[def](ast.def_ty_arg(tp.id));
}
}
}
case (ast.item_mod(_, ?m, _)) {
ret check_mod(i, m);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册