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

Improves error handling of method application args type checking. #5717

Merged
merged 2 commits into from Mar 12, 2024

Conversation

esdrubal
Copy link
Contributor

@esdrubal esdrubal commented Mar 11, 2024

Description

In some cases args type checking is returning an error in the handler but not in the result.
With this fix we check the handler for errors too.

Fixes #5659

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.

In some cases args type checking is returning an error in the handler but not in the result.
With this fix we check the handler for errors too.

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

Benchmark for 56724fe

Click to view benchmark
Test Base PR %
code_action 5.4±0.08ms 5.2±0.02ms -3.70%
code_lens 306.7±12.66ns 346.1±18.19ns +12.85%
compile 5.7±0.14s 5.7±0.08s 0.00%
completion 4.9±0.16ms 4.8±0.02ms -2.04%
did_change_with_caching 5.1±0.05s 5.1±0.03s 0.00%
document_symbol 986.7±31.89µs 964.9±16.09µs -2.21%
format 70.0±0.96ms 69.4±0.99ms -0.86%
goto_definition 357.3±3.03µs 359.9±6.47µs +0.73%
highlight 9.1±0.01ms 8.8±0.17ms -3.30%
hover 582.0±5.11µs 597.2±17.36µs +2.61%
idents_at_position 121.9±0.38µs 121.9±1.28µs 0.00%
inlay_hints 659.8±11.49µs 646.4±9.20µs -2.03%
on_enter 488.8±13.27ns 486.2±9.86ns -0.53%
parent_decl_at_position 3.7±0.03ms 3.6±0.16ms -2.70%
prepare_rename 360.4±5.00µs 361.4±6.69µs +0.28%
rename 9.6±0.12ms 9.2±0.03ms -4.17%
semantic_tokens 1048.0±9.28µs 1047.3±17.18µs -0.07%
token_at_position 359.9±2.23µs 356.9±2.08µs -0.83%
tokens_at_position 3.7±0.02ms 3.6±0.03ms -2.70%
tokens_for_file 419.5±2.30µs 414.0±2.77µs -1.31%
traverse 42.0±1.33ms 43.4±1.91ms +3.33%

@esdrubal esdrubal requested a review from a team March 11, 2024 13:24
@esdrubal esdrubal marked this pull request as ready for review March 11, 2024 13:24
Copy link

Benchmark for c852595

Click to view benchmark
Test Base PR %
code_action 5.3±0.05ms 5.3±0.17ms 0.00%
code_lens 287.0±8.17ns 292.0±7.96ns +1.74%
compile 6.2±0.08s 6.3±0.09s +1.61%
completion 4.8±0.10ms 4.8±0.09ms 0.00%
did_change_with_caching 5.7±0.05s 5.7±0.07s 0.00%
document_symbol 1015.7±28.42µs 953.1±21.13µs -6.16%
format 70.4±1.39ms 72.8±1.34ms +3.41%
goto_definition 357.2±5.61µs 357.5±7.06µs +0.08%
highlight 8.9±0.68ms 8.8±0.07ms -1.12%
hover 653.5±20.41µs 602.9±18.31µs -7.74%
idents_at_position 122.1±0.97µs 122.7±1.49µs +0.49%
inlay_hints 666.6±40.29µs 655.1±34.08µs -1.73%
on_enter 498.4±12.89ns 485.5±10.24ns -2.59%
parent_decl_at_position 3.6±0.08ms 3.7±0.32ms +2.78%
prepare_rename 357.9±6.05µs 354.8±8.79µs -0.87%
rename 9.2±0.04ms 9.2±0.24ms 0.00%
semantic_tokens 1036.5±14.72µs 1058.2±25.44µs +2.09%
token_at_position 358.9±6.69µs 351.7±3.74µs -2.01%
tokens_at_position 3.6±0.03ms 3.6±0.07ms 0.00%
tokens_for_file 414.6±1.86µs 409.3±3.59µs -1.28%
traverse 44.8±1.50ms 45.0±1.49ms +0.45%

@IGI-111 IGI-111 merged commit a099f34 into master Mar 12, 2024
35 checks passed
@IGI-111 IGI-111 deleted the esdrubal/5659_arg_type_check branch March 12, 2024 14:09
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.

Internal Compiler Error when calling methods and passing non-existing variables
3 participants