diff --git a/src/boot/me/semant.ml b/src/boot/me/semant.ml index 789a236060d7e..1992bf932e974 100644 --- a/src/boot/me/semant.ml +++ b/src/boot/me/semant.ml @@ -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 diff --git a/src/test/compile-fail/no-self-dispatch.rs b/src/test/compile-fail/no-self-dispatch.rs new file mode 100644 index 0000000000000..be90c12fec290 --- /dev/null +++ b/src/test/compile-fail/no-self-dispatch.rs @@ -0,0 +1,11 @@ +// error-pattern: unresolved identifier +obj oT() { + fn get() -> int { + ret 3; + } + fn foo() { + auto c = get(); + } +} +fn main() { +}