-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(experimental elaborator): Fix duplicate
resolve_type
on self ty…
…pe and don't leak a trait impl's generics (#5102) # Description ## Problem\* Resolves <!-- Link to GitHub Issue --> ## Summary\* Fixes two issues: - Use cached `resolved_object_type` instead of re-resolving the self type in `declare_methods_on_struct` and `check_trait_impl_coherence`. This is needed to prevent duplicate errors, and in the later case, since generics are not added to scope to be able to re-resolve the object type at that point. - Fix a case when resolving trait impls that `self.generics` was not cleared afterward. ## Additional Context Down to 112 errors in the standard library now. The remaining errors are variants of: - "Duplicate definitions of \<global> found" - "Duplicate definitions of \<generic> found" - looks to be only one case where there is a generic directly on a trait method. `fn hash<H>(self, state: &mut H) where H: Hasher;` - "Expression type is ambiguous" - from the two turbofish cases that haven't been merged in this branch yet - "Expected type &mut _, found type H" - issues with auto-deref and trait methods possibly - "No matching impl found for ..." - trait solver issues ## 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. --------- Co-authored-by: Tom French <[email protected]> Co-authored-by: Maxim Vezenov <[email protected]> Co-authored-by: Álvaro Rodríguez <[email protected]> Co-authored-by: guipublic <[email protected]>
- Loading branch information
1 parent
11e98f3
commit db561e2
Showing
4 changed files
with
135 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.