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

improve error messages for array items #6663

Merged
merged 4 commits into from
Oct 22, 2024
Merged

Conversation

xunilrj
Copy link
Contributor

@xunilrj xunilrj commented Oct 22, 2024

Description

This PR fixes an issue with array items that are typed as TypeInfo::Error. These errors were being swallowed and the compiler was failing later with an ICE.

Now we correctly show the more user-friendly error.

  --> test/src/e2e_vm_tests/test_programs/should_fail/array_wrong_elements_types/src/main.sw:51:26
   |
49 | 
50 |     // Literal too big
51 |     let mut a = [8u8, 8, 18446744073709551615];
   |                          ^^^^^^^^^^^^^^^^^^^^ Literal value is too large for type u8.
52 | }

Checklist

  • 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).
  • 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.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

Copy link

codspeed-hq bot commented Oct 22, 2024

CodSpeed Performance Report

Merging #6663 will not alter performance

Comparing xunilrj/better-array-errors (144b37b) with master (492db76)

Summary

✅ 22 untouched benchmarks

@xunilrj xunilrj marked this pull request as ready for review October 22, 2024 16:59
@xunilrj xunilrj requested a review from a team as a code owner October 22, 2024 16:59
@xunilrj xunilrj self-assigned this Oct 22, 2024
@JoshuaBatty JoshuaBatty merged commit bf9695f into master Oct 22, 2024
40 checks passed
@JoshuaBatty JoshuaBatty deleted the xunilrj/better-array-errors branch October 22, 2024 23:32
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.

3 participants