Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Don't type error when calling certain trait impls in the interpr…
…eter (#5471) # Description ## Problem\* Resolves #5428 ## Summary\* The interpreter was calling into `perform_impl_bindings` in more cases than the monomorphizer. Where the former calls into it for every trait impl method, the later only calls into it for methods called from a `TraitMethodExpr` or `ImplKind::TraitMethod` on an ident/operator. It seemed more correct to call into this function in all cases so I removed the bug by also replacing NamedGenerics in the trait itself with bindable type variables. ## Additional Context I've moved around some methods in `hir_def/types.rs` so that we don't have 3 separate `impl Type {`s in the one file. The only two changes in that file are the addition of `replace_named_generics_with_type_variables` and the formatting change for debugging NamedGenerics. ## Documentation\* Check one: - [x] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[For Experimental Features]** Documentation to be submitted in a separate PR. # PR Checklist\* - [x] I have tested the changes locally. - [x] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings.
- Loading branch information