forked from FuelLabs/sway
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes trait map issue on the use of absolute path (FuelLabs#4697)
## Description The test case use_absolute_path included in this PR was generating an error due to the `CallPath` `to_fullpath` generating `use_absolute_path::foo::trait::Trait` instead of `use_absolute_path::trait::Trait`. The issue was fixed by including a boolean in `namespace.use_synonyms` that indicates when the path is absolute. With that information `to_fullpath` can behave accordingly. Fixes FuelLabs#4696 ## 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: Joshua Batty <[email protected]>
- Loading branch information
1 parent
7245883
commit e8d6472
Showing
14 changed files
with
169 additions
and
32 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
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
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
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
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
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
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
13 changes: 13 additions & 0 deletions
13
test/src/e2e_vm_tests/test_programs/should_pass/language/use_absolute_path/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,13 @@ | ||
[[package]] | ||
name = 'core' | ||
source = 'path+from-root-9F4EED204534DB2D' | ||
|
||
[[package]] | ||
name = 'std' | ||
source = 'path+from-root-9F4EED204534DB2D' | ||
dependencies = ['core'] | ||
|
||
[[package]] | ||
name = 'use_absolute_path' | ||
source = 'member' | ||
dependencies = ['std'] |
8 changes: 8 additions & 0 deletions
8
test/src/e2e_vm_tests/test_programs/should_pass/language/use_absolute_path/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,8 @@ | ||
[project] | ||
authors = ["Fuel Labs <[email protected]>"] | ||
entry = "main.sw" | ||
license = "Apache-2.0" | ||
name = "use_absolute_path" | ||
|
||
[dependencies] | ||
std = { path = "../../../../../../../sway-lib-std" } |
25 changes: 25 additions & 0 deletions
25
...rc/e2e_vm_tests/test_programs/should_pass/language/use_absolute_path/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,25 @@ | ||
{ | ||
"configurables": [], | ||
"functions": [ | ||
{ | ||
"attributes": null, | ||
"inputs": [], | ||
"name": "main", | ||
"output": { | ||
"name": "", | ||
"type": 0, | ||
"typeArguments": null | ||
} | ||
} | ||
], | ||
"loggedTypes": [], | ||
"messagesTypes": [], | ||
"types": [ | ||
{ | ||
"components": null, | ||
"type": "u64", | ||
"typeId": 0, | ||
"typeParameters": null | ||
} | ||
] | ||
} |
Oops, something went wrong.