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 issues found during testing of the Iterator implementation for StorageVec #6829

Open
ironcev opened this issue Jan 10, 2025 · 0 comments
Labels
bug Something isn't working compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen

Comments

@ironcev
Copy link
Member

ironcev commented Jan 10, 2025

The tests written in #6821 fails for types (), [u64;0], and the EmptyStruct.

Using () causes an ICE:

error
   --> /.../sway/sway-lib-std/src/option.sw:191:15
    |
189 |     /// ```
190 |     pub fn unwrap(self) -> T {
191 |         match self {
    |               ^^^^ Internal compiler error: Failed to get variant type from enum in `unsigned downcast`.
Please file an issue on the repository and include the code that triggered this error.
192 |             Self::Some(inner_value) => inner_value,
193 |             _ => revert(0),
    |

The other two types are zero-sized, and we've already had various issues with such types in the past.

Because of that and the fact that all the tests are passing for all other tested types, it is reasonable to assume that the issues have nothing to do with the implementation of the Iterator trait, but are rather some underlying already existing issues.

@ironcev ironcev added bug Something isn't working compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen labels Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen
Projects
None yet
Development

No branches or pull requests

1 participant