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: Lazily elaborate functions in comptime interpreter #5604

Merged
merged 5 commits into from
Jul 25, 2024

Conversation

jfecher
Copy link
Contributor

@jfecher jfecher commented Jul 25, 2024

Description

Problem*

Resolves #5538 (comment)

Summary*

If a function with an empty body is found within the comptime interpreter we now lazily elaborate it instead of failing with an error.

Additional Context

The test for this is noir_test_success_comptime_globals which after #5538 requires lazy elaboration due to comptime globals themselves now being elaborated before functions.

This PR opens the way to be more lax about marking functions comptime and potentially lets us remove the restriction that you can only call non-comptime functions in separate modules.

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 July 25, 2024 17:01
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.

Small question r.e. tearing down the fresh elaborator, otherwise LGTM

@jfecher jfecher merged commit c7579ff into jf/filter-comptime-globals Jul 25, 2024
42 of 43 checks passed
@jfecher jfecher deleted the jf/lazy-evaluate branch July 25, 2024 17:47
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