Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(experimental elaborator): Fix panic during monomorphization #5126

Merged
merged 2 commits into from
May 28, 2024

Conversation

jfecher
Copy link
Contributor

@jfecher jfecher commented May 28, 2024

Description

Problem*

Resolves a panic in the elaborator during monomorphization related to parameters being resolved twice and having a different DefinitionId the second time.

Summary*

I've stored the original ids from the first resolution and switched to using only those.

Additional Context

Documentation*

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

pattern,
typ.clone(),
DefinitionKind::Local(None),
&mut parameter_idents,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels like it may be cleaner to just save the hir idents on self then it can cleared after we are done elaborating a function meta. We can then remove the #[allow(clippy::too_many_arguments)] and the threading of the mutable reference.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to avoid cluttering self with too many fields that are only used temporarily in a couple functions. Otherwise the object grows even larger, and it's already quite large since it has all of the name resolver's and type checker's fields.

Copy link
Contributor

@michaeljklein michaeljklein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jfecher jfecher merged commit 13173e8 into jf/elaborator-fixes7 May 28, 2024
42 checks passed
@jfecher jfecher deleted the jf/elaborator-fixes8 branch May 28, 2024 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants