Fix over-optimistic resolution of self-methods within obj scopes. There is no such feature in the language at present. Add test to prevent regression. Closes #114.

This commit is contained in:
Graydon Hoare 2010-07-19 12:03:58 -07:00
parent bacb8e6b79
commit f1db420317
2 changed files with 12 additions and 5 deletions

View File

@ -1758,11 +1758,7 @@ and lookup_by_ident
check_slots scopes f.Ast.fn_input_slots
| Ast.MOD_ITEM_obj obj ->
begin
match htab_search obj.Ast.obj_fns ident with
Some fn -> found cx scopes fn.id
| None -> check_slots scopes obj.Ast.obj_state
end
check_slots scopes obj.Ast.obj_state
| Ast.MOD_ITEM_mod md ->
project_ident_from_items cx lchk

View File

@ -0,0 +1,11 @@
// error-pattern: unresolved identifier
obj oT() {
fn get() -> int {
ret 3;
}
fn foo() {
auto c = get();
}
}
fn main() {
}