check arg_idx >= n_params only if arg_idx >= n_required_params

This commit is contained in:
Hongxu Xu 2022-07-07 00:54:46 +08:00
parent 75fb3de310
commit 0360ed53cf

View File

@ -181,12 +181,12 @@ pub(crate) fn complete_type_path(
acc.add_type_alias_with_eq(ctx, alias);
}
});
}
let n_params =
trait_.type_or_const_param_count(ctx.sema.db, false);
if arg_idx >= n_params {
return; // only show assoc types
let n_params =
trait_.type_or_const_param_count(ctx.sema.db, false);
if arg_idx >= n_params {
return; // only show assoc types
}
}
}
}