-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improves error handling of method application args type checking. (#5717
) ## 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 - [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). - [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). - [x] I have requested a review from the relevant team or maintainers. Co-authored-by: João Matos <joao@tritao.eu>
- Loading branch information
Showing
6 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...c/e2e_vm_tests/test_programs/should_fail/method_type_args_variable_non_existing/Forc.lock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[[package]] | ||
name = "method_type_args_variable_non_existing" | ||
source = "member" |
6 changes: 6 additions & 0 deletions
6
...c/e2e_vm_tests/test_programs/should_fail/method_type_args_variable_non_existing/Forc.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[project] | ||
authors = ["Fuel Labs <contact@fuel.sh>"] | ||
license = "Apache-2.0" | ||
name = "method_type_args_variable_non_existing" | ||
entry = "main.sw" | ||
implicit-std = false |
1 change: 1 addition & 0 deletions
1
...sts/test_programs/should_fail/method_type_args_variable_non_existing/json_abi_oracle.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[] |
13 changes: 13 additions & 0 deletions
13
...e2e_vm_tests/test_programs/should_fail/method_type_args_variable_non_existing/src/main.sw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
script; | ||
|
||
struct S {} | ||
|
||
impl S { | ||
fn method(self, a: u64) -> u64 { | ||
a | ||
} | ||
} | ||
|
||
fn main() { | ||
let _ = S {}.method(non_existing); | ||
} |
4 changes: 4 additions & 0 deletions
4
...c/e2e_vm_tests/test_programs/should_fail/method_type_args_variable_non_existing/test.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
category = "fail" | ||
|
||
# check: $()let _ = S {}.method(non_existing); | ||
# nextln: $()Variable "non_existing" does not exist in this scope. |