Skip to content

Commit bc9db2e

Browse files
committed
Teach resolve to find obj fields and ty params from methods.
1 parent a9d03dd commit bc9db2e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/comp/middle/resolve.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,18 @@ fn lookup_name(&env e, ast.ident i) -> option.t[def] {
115115
}
116116
}
117117
}
118+
case (ast.item_obj(_, ?ob, ?ty_params, _, _)) {
119+
for (ast.obj_field f in ob.fields) {
120+
if (_str.eq(f.ident, i)) {
121+
ret some[def](ast.def_obj_field(f.id));
122+
}
123+
}
124+
for (ast.ty_param tp in ty_params) {
125+
if (_str.eq(tp.ident, i)) {
126+
ret some[def](ast.def_ty_arg(tp.id));
127+
}
128+
}
129+
}
118130
case (ast.item_mod(_, ?m, _)) {
119131
ret check_mod(i, m);
120132
}

0 commit comments

Comments
 (0)