Skip to content

Fixes argument errors not displayed. #5909

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

Merged
merged 2 commits into from
Feb 9, 2025

Conversation

esdrubal
Copy link
Contributor

@esdrubal esdrubal commented Apr 23, 2024

Description

type_check_method_application does the parsing of arguments in 2 passes, but when the resolved_method_name failed the argument error would not be displayed.

We now store the arg_handlers and append their errors in case resolve_method_name fails.

Fixes #5660

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.

@esdrubal esdrubal self-assigned this Apr 23, 2024
@esdrubal esdrubal added compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen bug Something isn't working labels Apr 23, 2024
Copy link

Benchmark for 60e752f

Click to view benchmark
Test Base PR %
code_action 5.3±0.06ms 5.4±0.21ms +1.89%
code_lens 337.4±10.48ns 326.6±17.31ns -3.20%
compile 6.2±0.03s 6.2±0.06s 0.00%
completion 4.8±0.15ms 4.9±0.10ms +2.08%
did_change_with_caching 6.2±0.12s 6.1±0.08s -1.61%
document_symbol 938.6±46.91µs 1066.6±16.94µs +13.64%
format 74.1±0.62ms 74.5±1.22ms +0.54%
goto_definition 364.1±5.25µs 357.8±9.14µs -1.73%
highlight 8.8±0.25ms 8.8±0.37ms 0.00%
hover 601.3±21.00µs 600.4±24.07µs -0.15%
idents_at_position 124.1±1.18µs 122.6±1.51µs -1.21%
inlay_hints 647.9±22.59µs 649.5±27.11µs +0.25%
on_enter 479.3±14.23ns 479.7±14.06ns +0.08%
parent_decl_at_position 3.6±0.05ms 3.6±0.05ms 0.00%
prepare_rename 369.5±19.30µs 357.2±6.83µs -3.33%
rename 9.5±0.74ms 9.6±0.46ms +1.05%
semantic_tokens 1105.2±16.37µs 1037.7±22.17µs -6.11%
token_at_position 358.3±3.57µs 359.5±3.17µs +0.33%
tokens_at_position 3.6±0.04ms 3.6±0.06ms 0.00%
tokens_for_file 427.7±6.13µs 425.3±3.24µs -0.56%
traverse 51.4±1.87ms 52.3±2.77ms +1.75%

type_check_method_application does the parsing of arguments in 2 passes,
but when the resolved_method_name failed the argument error would not be displayed.

We now store the arg_handlers and append their errors in case resolve_method_name fails.

Fixes #5660
@esdrubal esdrubal force-pushed the esdrubal/5660_fix_arg_error_not_displayed branch from 5d6ae37 to e9c18b5 Compare February 3, 2025 13:22
Copy link

codspeed-hq bot commented Feb 3, 2025

CodSpeed Performance Report

Merging #5909 will not alter performance

Comparing esdrubal/5660_fix_arg_error_not_displayed (637ff93) with master (b7123c5)

Summary

✅ 22 untouched benchmarks

@esdrubal esdrubal marked this pull request as ready for review February 3, 2025 13:46
@esdrubal esdrubal requested a review from a team as a code owner February 3, 2025 13:46
@JoshuaBatty JoshuaBatty enabled auto-merge (squash) February 9, 2025 01:32
@JoshuaBatty JoshuaBatty merged commit c288563 into master Feb 9, 2025
41 checks passed
@JoshuaBatty JoshuaBatty deleted the esdrubal/5660_fix_arg_error_not_displayed branch February 9, 2025 01:50
sdankel pushed a commit that referenced this pull request Feb 11, 2025
## Description

`type_check_method_application` does the parsing of arguments in 2
passes, but when the `resolved_method_name` failed the argument error
would not be displayed.

We now store the arg_handlers and append their errors in case
`resolve_method_name` fails.

Fixes #5660

## 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.
- [x] 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).
- [ ] I have requested a review from the relevant team or maintainers.

Co-authored-by: Joshua Batty <[email protected]>
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

Successfully merging this pull request may close these issues.

When calling associated functions and operators, errors shown only on the first parameter
4 participants