-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Impl search no longer selects an impl if multiple are applicable (…
…#4662) # Description ## Problem\* Resolves #4653 ## Summary\* If the object type is an unbound type variable, impl search currently just chooses the first available matching impl instead of erroring that type annotations are needed or similar. This can lead to confusing situations where the type chosen is chosen just because it was the first impl in the stdlib to be defined. This PR prevents that. ## Additional Context This PR depends on #4648 and should be merged after. ~~The `hashmap` test is currently failing because the `H: Hasher` constraint on its `Eq` implementation ~~is actually unsolvable since `H` isn't mentioned in the hashmap type at all~~. It is solvable since it is meantioned in `B`, although solving it so far has lead to errors during monomorphization. Previously it was fine since H was unbound and the first/only impl was just always chosen. Now I'll need to change or remove H to fix it.~~ This PR is now ready to review. I've been debugging a bug with monomorphizing some HashMap code for a little while but it turns out the bug is also present in master. So I'm considering it a separate issue: #4663 ## 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
1 parent
c1f279f
commit d251309
Showing
6 changed files
with
113 additions
and
46 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
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
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
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
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
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