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: Fix evaluation of globals from other crates #5658

Merged
merged 2 commits into from
Aug 2, 2024

Conversation

jfecher
Copy link
Contributor

@jfecher jfecher commented Aug 1, 2024

Description

Problem*

Resolves

Summary*

We stored comptime_scopes in the Elaborator, but elaborators are created one per each crate. So any globals from other crates would be invisible to each next crate, or their value would be reset. I've moved comptime_scopes to the NodeInterner to fix this.

Additional Context

With this, derive now works in the stdlib. I've decided to split adding that into a separate PR though.

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 requested a review from a team August 1, 2024 14:47
@jfecher jfecher mentioned this pull request Aug 1, 2024
5 tasks
# Description

## Problem\*

Resolves #5628

## Summary\*

The original error in the issue has since been fixed, but there have
been more after it. #5658 fixes
the last issue and with it, derive can be added to the stdlib without
errors. I've edited the `derive` test to show this.

## Additional Context

After this, I'm making another separate PR to add some derive functions
for common traits like Eq and Default.

## Documentation\*

Check one:
- [ ] No documentation needed.
- [ ] Documentation included in this PR.
- [x] **[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.
@jfecher jfecher merged commit bdb02bd into jf/value-print Aug 2, 2024
23 checks passed
@jfecher jfecher deleted the jf/fix-comptime-globals-again branch August 2, 2024 14:08
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