Add SelfParam to code_model

This commit is contained in:
Aleksey Kladov 2020-08-19 15:16:24 +02:00
parent a3b0a3aeb8
commit b9b4693ce3
9 changed files with 62 additions and 43 deletions

View file

@ -545,7 +545,7 @@ impl<'db, 'sema> Matcher<'db, 'sema> {
// If the function we're calling takes a self parameter, then we store additional
// information on the placeholder match about autoderef and autoref. This allows us to use
// the placeholder in a context where autoderef and autoref don't apply.
if code_resolved_function.has_self_param(self.sema.db) {
if code_resolved_function.self_param(self.sema.db).is_some() {
if let (Some(pattern_type), Some(expr)) = (&pattern_ufcs.qualifier_type, &code.expr()) {
let deref_count = self.check_expr_type(pattern_type, expr)?;
let pattern_receiver = pattern_args.next();