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

feat: replace eval_global_as_array_length with type/interpreter evaluation #6469

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

michaeljklein
Copy link
Contributor

Description

Problem*

Resolves #6238

Summary*

Current plan:

  • Resolve globals to:
    1. Type::InfixExpr / Type::Constant if possible
    • Where nested globals can be appx. Type::Global(GlobalId)
    1. comptime globals otherwise (to allow using the existing interpreter)
    • Require such globals to be explicitly comptime
  • Use existing type-checking and interpreting code paths instead of eval_global_as_array_length

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.

@TomAFrench
Copy link
Member

Discussed in 1:1 that we're going to require globals to have their type declared explicitly which also fixes the issues in this PR.

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.

Fix eval_global_as_array_length to support non-array-length types
2 participants