Skip to content

Commit

Permalink
frontend: Remove one more use of MethodLookup
Browse files Browse the repository at this point in the history
  • Loading branch information
dinfuehr committed Nov 15, 2024
1 parent 83219e9 commit afe0797
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions dora-frontend/src/typeck/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ fn check_expr_call_field(
e: &ast::ExprCallType,
object_type: SourceType,
method_name: String,
type_params: SourceTypeArray,
_type_params: SourceTypeArray,
arguments: CallArguments,
) -> SourceType {
let interned_method_name = ck.sa.interner.intern(&method_name);
Expand Down Expand Up @@ -481,18 +481,12 @@ fn check_expr_call_field(
}
}

let arg_types = &arguments.assume_all_positional(ck);

// No field with that name as well, so report method
let lookup = MethodLookup::new(ck.sa, ck.file_id, ck.type_param_definition)
.parent(ck.parent.clone())
.method(object_type)
.name(interned_method_name)
.fct_type_params(&type_params)
.span(e.span)
.args(arg_types)
.find();
assert!(!lookup.find());
let ty = ck.ty_name(&object_type);
ck.sa.report(
ck.file_id,
e.span,
ErrorMessage::UnknownMethod(ty, method_name),
);

ck.analysis.set_ty(e.id, ty_error());

Expand Down

0 comments on commit afe0797

Please sign in to comment.