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

Type/Expression Tandem #6806

Open
wants to merge 24 commits into
base: trunk
Choose a base branch
from
Open

Conversation

kentslaney
Copy link
Contributor

@kentslaney kentslaney commented Dec 22, 2024

Connections
Addresses #6788

Description
With the introduction of override-sized arrays, expressions can now refer to types. The existing compactor was built assuming a one directional dependency, meaning that unused types wouldn't have the supporting expressions removed. This PR removes that directionality assumption by tracing the types used by expressions in order to propagate usage. It also validates that any expression A that relies on a type that relies on another expression B has index A > B.

Testing
This is tested by checking that going from expression to type and back, along with the opposite, is correctly marked as used. The updated validation is checked by ensuring an error is raised when an out of order dependency is introduced.

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy. If applicable, add:
    • --target wasm32-unknown-unknown
    • --target wasm32-unknown-emscripten
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file.

@kentslaney kentslaney marked this pull request as ready for review December 31, 2024 04:57
@kentslaney kentslaney requested a review from a team as a code owner December 31, 2024 04:57
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