Latest Results
Fix `get_runtime_representation` and const-eval of `EnumInstantiation` (#7692)
## Description
This PR:
- fixes the runtime representations of `TypeContent::Array` and
`TypeContent::Union` calculated in `get_runtime_representation`:
- Arrays were padded to word boundary, which originally caused #7690.
- Unions were always having a size of minimum 8 bytes, even if all their
variants were zero-sized. Union variants were right-padded to word
boundary, instead of being left-padded.
- fixes the `const_eval` of `EnumInstantiation` to not add variant
payloads if the enum is compiled only to a tag.
The PR also improves compilation of enums whose all variants are
zero-sized. Up to now, it was required that all the variants must be
unit for the enum to be compiled only to a tag. This PR loosens this
requirement too all zero-sized types.
Additionally, the PR:
- adds IR verification that checks that a global's initializer fits to
the expected global type.
- in `MemoryRepresentation` adds padding in struct fields to a padded
field, and does not inserts them as additional elements. This accurately
reflects what gets padded and the underlying struct structure.
- makes `insta::assert_snapshot` fail if `logs` get changed in tests
that use them, like in the `type_layout` test.
- deletes redundant ABI JSON validation from `match` expressions tests.
Three tests extended or added in this PR use the same types and those
are currently copy-pasted across the tests. We had this situation
before. We will create a separate utility project that provides common
types and traits for tests as a part of #7693.
- Fixes #7690.
- Fixes #7691.
## Checklist
- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers. Latest Branches
0%
xunilrj/fix-sroa-load-multi-blocks -15%
ironcev/fix-get-runtime-representation +11%
© 2026 CodSpeed Technology