-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Account for the expected kind when resolving turbofish generics (#…
…5448) # Description ## Problem\* Resolves #5442 ## Summary\* In #5155 we make sure that we make sure we resolve against the correct type kind in various places such as when resolving trait bound generics or trait impl generics. This was not done for function calls. Now when resolving turbofish generics, rather than calling `resolve_type` in all cases aside type expressions, we check whether the variable we are elaborating is a function and fetch its already resolved generics and pass that in as the expected kind. To keep the resolution logic the simple (I just zipped together the `direct_generics` from the function meta and the user specified turbofish generics), as `zip` uses the shortest iterator, I also added two checks for whether we have the correct turbofish count. We now have multiple of these checks rather than in just `instantiate`, but I felt it was the simplest logic and would lead to the least potential future confusion. I also have expanded the bug identified in the issue to also include turbofish generics for method calls. I have also included this as part of my test for this PR. ## Additional Context ## 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: jfecher <jake@aztecprotocol.com>
- Loading branch information
Showing
7 changed files
with
186 additions
and
37 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
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