You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here we instantiate variable x with the result of produce(). Since produce() returns a generic type,
the concrete type of x cannot be determined just yet: it can either be u64 or u32. Since x is later passed
to consume(), which only accepts u32, type inference should assign this type to x. However, the
compiler fails to use this information and rejects the program, as it assumes x to be of type u64.
The text was updated successfully, but these errors were encountered:
## Description
This PR adds tests that prove that #6379 is fixed. The actual fix
happened in #6490.
Closes#6379.
## Checklist
- [x] I have linked to any relevant issues.
- [ ] 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.
CS-FSSA-013
Sway's type system ignores some hints about the type of variables. Let us consider the following
example:
Here we instantiate variable x with the result of produce(). Since produce() returns a generic type,
the concrete type of x cannot be determined just yet: it can either be u64 or u32. Since x is later passed
to consume(), which only accepts u32, type inference should assign this type to x. However, the
compiler fails to use this information and rejects the program, as it assumes x to be of type u64.
The text was updated successfully, but these errors were encountered: