-
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(experimental elaborator): Only call
add_generics
once (#5091)
# Description ## Problem\* Resolves an issue introduced by #5082 where `add_generics` would be called multiple times on a given item. Once when declaring the FuncMeta beforehand, and again when defining it afterward. This is an issue because `add_generics` will give a fresh set of generics each time. This meant the generics in a function's signature weren't the same type variables as the ones used internally, which led to type errors. ## Summary\* ## Additional Context Down to ~~400~~ 226 errors in the stdlib down from 1050 Edit: Fixed a case where structs never popped their generics out of scope ## 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: Maxim Vezenov <mvezenov@gmail.com>
- Loading branch information
Showing
7 changed files
with
154 additions
and
103 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.