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): Avoid defining globals twice #5103

Merged
merged 1 commit into from
May 28, 2024

Conversation

jfecher
Copy link
Contributor

@jfecher jfecher commented May 24, 2024

Description

Problem*

Fixes the "Duplicate definitions of found" error by removing resolve_local_globals.

Summary*

Additional Context

We don't need to re-add globals to scope anymore via resolve_local_globals since we're not creating a new Elaborator for each function like we do for NameResolvers. The flip side of this is that I think we'll need to change how globals are stored eventually so that they're not all always visible. I think how it is now may violate imports but I'll leave that for a later fix to keep these PRs small. (and wait until I have a test case that shows it).

Down to 61 errors after this PR. The errors are:

  • "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:

  • 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.

@jfecher jfecher merged commit 31e4228 into jf/elaborator-fixes4 May 28, 2024
42 checks passed
@jfecher jfecher deleted the jf/elaborator-fixes5 branch May 28, 2024 18:42
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.

2 participants