-
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.
Add tests for recursive
const
definitions and associated consts usa…
…ges (#6545) ## Description This PR adds additional tests for constants. Those test cases are important for the implementation of #6351 which will completely restructure compilation of constants. Tests for recursive `const` definitions should also be considered before we start implementing `const fn` and `const trait`. In particular, we want to better track and provide precise error messages in case of unintended attempt to recursively define a constant in a complex situation that includes `const fn` and `const trait`. Related to #6534, #6537, #6538, #6539, #6540, #6543, and #6544. ## Checklist - [x] 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). - [ ] 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. - [ ] 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.
- Loading branch information
Showing
48 changed files
with
353 additions
and
18 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
test/src/e2e_vm_tests/test_programs/should_fail/const_block_level_no_expr/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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
script; | ||
library; | ||
|
||
fn main() -> u64 { | ||
const X; | ||
|
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 |
---|---|---|
|
@@ -2,3 +2,5 @@ category = "fail" | |
|
||
# check: $()const X; | ||
# nextln: $()Constant requires expression. | ||
|
||
# check: $()1 error. |
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 |
---|---|---|
|
@@ -2,3 +2,5 @@ category = "fail" | |
|
||
# check: $()const X; | ||
# nextln: $()Constant requires expression. | ||
|
||
# check: $()1 error. |
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
test/src/e2e_vm_tests/test_programs/should_fail/recursive_const_associated/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 = "recursive_const_associated" | ||
source = "member" |
6 changes: 6 additions & 0 deletions
6
test/src/e2e_vm_tests/test_programs/should_fail/recursive_const_associated/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] | ||
name = "recursive_const_associated" | ||
authors = ["Fuel Labs <contact@fuel.sh>"] | ||
entry = "main.sw" | ||
license = "Apache-2.0" | ||
implicit-std = false |
13 changes: 13 additions & 0 deletions
13
test/src/e2e_vm_tests/test_programs/should_fail/recursive_const_associated/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 @@ | ||
library; | ||
|
||
struct S {} | ||
|
||
// TODO: Uncomment this code, and enable this test and add checks once https://github.com/FuelLabs/sway/issues/6537 is fixed. | ||
impl S { | ||
// const A: u8 = Self::B; | ||
// const B: u8 = Self::A; | ||
|
||
// const X: u8 = Self::Y; | ||
// const Y: u8 = Self::Z; | ||
// const Z: u8 = Self::X; | ||
} |
1 change: 1 addition & 0 deletions
1
test/src/e2e_vm_tests/test_programs/should_fail/recursive_const_associated/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 @@ | ||
category = "disabled" # TODO: Enable this test and add checks once https://github.com/FuelLabs/sway/issues/6537 is fixed. |
3 changes: 3 additions & 0 deletions
3
...s/test_programs/should_fail/recursive_const_associated_over_associated_function/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 = "recursive_const_associated_over_associated_function" | ||
source = "member" |
6 changes: 6 additions & 0 deletions
6
...s/test_programs/should_fail/recursive_const_associated_over_associated_function/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] | ||
name = "recursive_const_associated_over_associated_function" | ||
authors = ["Fuel Labs <contact@fuel.sh>"] | ||
entry = "main.sw" | ||
license = "Apache-2.0" | ||
implicit-std = false |
13 changes: 13 additions & 0 deletions
13
...test_programs/should_fail/recursive_const_associated_over_associated_function/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 @@ | ||
library; | ||
|
||
struct S {} | ||
|
||
impl S { | ||
fn assoc() -> u8 { | ||
Self::S_ASSOC | ||
} | ||
} | ||
|
||
impl S { | ||
const S_ASSOC: u8 = Self::assoc(); | ||
} |
9 changes: 9 additions & 0 deletions
9
...s/test_programs/should_fail/recursive_const_associated_over_associated_function/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,9 @@ | ||
category = "fail" | ||
|
||
#check: $()Self::S_ASSOC | ||
#nextln: $()Could not find symbol "S_ASSOC" in this scope. | ||
|
||
#check: $()const S_ASSOC: u8 = Self::assoc(); | ||
#nextln: $()No method named "assoc" found for type "S". | ||
|
||
#check: $()2 errors. |
3 changes: 3 additions & 0 deletions
3
...tests/test_programs/should_fail/recursive_const_associated_over_module_function/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 = "recursive_const_associated_over_module_function" | ||
source = "member" |
6 changes: 6 additions & 0 deletions
6
...tests/test_programs/should_fail/recursive_const_associated_over_module_function/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] | ||
name = "recursive_const_associated_over_module_function" | ||
authors = ["Fuel Labs <contact@fuel.sh>"] | ||
entry = "main.sw" | ||
license = "Apache-2.0" | ||
implicit-std = false |
11 changes: 11 additions & 0 deletions
11
...sts/test_programs/should_fail/recursive_const_associated_over_module_function/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,11 @@ | ||
library; | ||
|
||
struct S {} | ||
|
||
fn mod_fn() -> u8 { | ||
S::S_ASSOC | ||
} | ||
|
||
impl S { | ||
const S_ASSOC: u8 = mod_fn(); | ||
} |
1 change: 1 addition & 0 deletions
1
...tests/test_programs/should_fail/recursive_const_associated_over_module_function/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 @@ | ||
category = "disabled" # TODO: Enable this failing test and write checks once https://github.com/FuelLabs/sway/issues/6539 is fixed. |
3 changes: 3 additions & 0 deletions
3
test/src/e2e_vm_tests/test_programs/should_fail/recursive_const_module/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 = "recursive_const_module" | ||
source = "member" |
6 changes: 6 additions & 0 deletions
6
test/src/e2e_vm_tests/test_programs/should_fail/recursive_const_module/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] | ||
name = "recursive_const_module" | ||
authors = ["Fuel Labs <contact@fuel.sh>"] | ||
entry = "main.sw" | ||
license = "Apache-2.0" | ||
implicit-std = false |
8 changes: 8 additions & 0 deletions
8
test/src/e2e_vm_tests/test_programs/should_fail/recursive_const_module/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,8 @@ | ||
library; | ||
|
||
pub const A: u8 = B; | ||
pub const B: u8 = A; | ||
|
||
pub const X: u8 = Y; | ||
pub const Y: u8 = Z; | ||
pub const Z: u8 = X; |
10 changes: 10 additions & 0 deletions
10
test/src/e2e_vm_tests/test_programs/should_fail/recursive_const_module/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,10 @@ | ||
category = "fail" # TODO: Adjust these checks once https://github.com/FuelLabs/sway/issues/6534 is fixed. | ||
|
||
# check: $()Type B is recursive via A, which is unsupported at this time. | ||
# check: $()Type A is recursive via B, which is unsupported at this time. | ||
|
||
# check: $()Type Y is recursive via Z and X, which is unsupported at this time. | ||
# check: $()Type Z is recursive via X and Y, which is unsupported at this time. | ||
# check: $()Type X is recursive via Y and Z, which is unsupported at this time. | ||
|
||
# check: $()5 errors. |
3 changes: 3 additions & 0 deletions
3
...vm_tests/test_programs/should_fail/recursive_const_module_over_associated_const/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 = "recursive_const_module_over_associated_const" | ||
source = "member" |
6 changes: 6 additions & 0 deletions
6
...vm_tests/test_programs/should_fail/recursive_const_module_over_associated_const/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] | ||
name = "recursive_const_module_over_associated_const" | ||
authors = ["Fuel Labs <contact@fuel.sh>"] | ||
entry = "main.sw" | ||
license = "Apache-2.0" | ||
implicit-std = false |
9 changes: 9 additions & 0 deletions
9
..._tests/test_programs/should_fail/recursive_const_module_over_associated_const/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,9 @@ | ||
library; | ||
|
||
struct S {} | ||
|
||
impl S { | ||
const S_ASSOC: u8 = MOD_CONST; | ||
} | ||
|
||
const MOD_CONST: u8 = S::S_ASSOC; |
11 changes: 11 additions & 0 deletions
11
...vm_tests/test_programs/should_fail/recursive_const_module_over_associated_const/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,11 @@ | ||
category = "fail" | ||
|
||
#check: $()error | ||
#check: $()const MOD_CONST: u8 = S::S_ASSOC; | ||
#nextln: $()Could not find symbol "S_ASSOC" in this scope. | ||
|
||
#check: $()error | ||
#check: $()const MOD_CONST: u8 = S::S_ASSOC; | ||
#nextln: $()Could not evaluate initializer to a const declaration. | ||
|
||
#check: $()2 errors. |
3 changes: 3 additions & 0 deletions
3
...tests/test_programs/should_fail/recursive_const_module_over_associated_function/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 = "recursive_const_module_over_associated_function" | ||
source = "member" |
6 changes: 6 additions & 0 deletions
6
...tests/test_programs/should_fail/recursive_const_module_over_associated_function/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] | ||
name = "recursive_const_module_over_associated_function" | ||
authors = ["Fuel Labs <contact@fuel.sh>"] | ||
entry = "main.sw" | ||
license = "Apache-2.0" | ||
implicit-std = false |
11 changes: 11 additions & 0 deletions
11
...sts/test_programs/should_fail/recursive_const_module_over_associated_function/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,11 @@ | ||
library; | ||
|
||
struct S {} | ||
|
||
impl S { | ||
fn assoc() -> u8 { | ||
MOD_CONST | ||
} | ||
} | ||
|
||
const MOD_CONST: u8 = S::assoc(); |
9 changes: 9 additions & 0 deletions
9
...tests/test_programs/should_fail/recursive_const_module_over_associated_function/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,9 @@ | ||
category = "fail" | ||
|
||
#check: $()const MOD_CONST: u8 = S::assoc(); | ||
#nextln: $()No method named "assoc" found for type "S". | ||
|
||
#check: $()const MOD_CONST: u8 = S::assoc(); | ||
#nextln: $()Could not evaluate initializer to a const declaration. | ||
|
||
#check: $()2 errors. |
3 changes: 3 additions & 0 deletions
3
..._vm_tests/test_programs/should_fail/recursive_const_module_over_module_function/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 = "recursive_const_module_over_module_function" | ||
source = "member" |
6 changes: 6 additions & 0 deletions
6
..._vm_tests/test_programs/should_fail/recursive_const_module_over_module_function/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] | ||
name = "recursive_const_module_over_module_function" | ||
authors = ["Fuel Labs <contact@fuel.sh>"] | ||
entry = "main.sw" | ||
license = "Apache-2.0" | ||
implicit-std = false |
7 changes: 7 additions & 0 deletions
7
...m_tests/test_programs/should_fail/recursive_const_module_over_module_function/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,7 @@ | ||
library; | ||
|
||
fn mod_fn() -> u8 { | ||
MOD_CONST | ||
} | ||
|
||
const MOD_CONST: u8 = mod_fn(); |
11 changes: 11 additions & 0 deletions
11
..._vm_tests/test_programs/should_fail/recursive_const_module_over_module_function/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,11 @@ | ||
category = "fail" | ||
|
||
#check: $()error | ||
#check: $()const MOD_CONST: u8 = mod_fn(); | ||
#nextln: $()Could not find symbol "mod_fn" in this scope. | ||
|
||
#check: $()error | ||
#check: $()const MOD_CONST: u8 = mod_fn(); | ||
#nextln: $()Could not evaluate initializer to a const declaration. | ||
|
||
#check: $()2 errors. |
3 changes: 3 additions & 0 deletions
3
test/src/e2e_vm_tests/test_programs/should_fail/recursive_const_stack_overflow/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 = "recursive_const_stack_overflow" | ||
source = "member" |
6 changes: 6 additions & 0 deletions
6
test/src/e2e_vm_tests/test_programs/should_fail/recursive_const_stack_overflow/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] | ||
name = "recursive_const_stack_overflow" | ||
authors = ["Fuel Labs <contact@fuel.sh>"] | ||
entry = "main.sw" | ||
license = "Apache-2.0" | ||
implicit-std = false |
17 changes: 17 additions & 0 deletions
17
test/src/e2e_vm_tests/test_programs/should_fail/recursive_const_stack_overflow/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,17 @@ | ||
// This test proves that https://github.com/FuelLabs/sway/issues/6540 is fixed. | ||
|
||
library; | ||
|
||
pub const MOD_FN: u8 = mod_fn(); | ||
|
||
fn mod_fn() -> u8 { | ||
MOD_FN | ||
} | ||
|
||
struct S {} | ||
|
||
impl S { | ||
const S_ASSOC: u8 = MOD_CONST; | ||
} | ||
|
||
const MOD_CONST: u8 = S::S_ASSOC; |
1 change: 1 addition & 0 deletions
1
test/src/e2e_vm_tests/test_programs/should_fail/recursive_const_stack_overflow/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 @@ | ||
category = "disabled" # TODO: Enable this failing test and write checks once https://github.com/FuelLabs/sway/issues/6540 is fixed. |
6 changes: 1 addition & 5 deletions
6
test/src/e2e_vm_tests/test_programs/should_fail/recursive_enum/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 |
---|---|---|
@@ -1,11 +1,7 @@ | ||
script; | ||
library; | ||
|
||
enum E { | ||
Eins: bool, | ||
Zwei: u64, | ||
Drei: E, | ||
} | ||
|
||
fn main() { | ||
|
||
} |
2 changes: 2 additions & 0 deletions
2
test/src/e2e_vm_tests/test_programs/should_fail/recursive_enum/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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
category = "fail" | ||
|
||
# check: $()recursive types are not supported | ||
|
||
# check: $()1 error. |
6 changes: 1 addition & 5 deletions
6
test/src/e2e_vm_tests/test_programs/should_fail/recursive_struct/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 |
---|---|---|
@@ -1,11 +1,7 @@ | ||
script; | ||
library; | ||
|
||
struct S { | ||
Eins: bool, | ||
Zwei: u64, | ||
Drei: S, | ||
} | ||
|
||
fn main() { | ||
|
||
} |
2 changes: 2 additions & 0 deletions
2
test/src/e2e_vm_tests/test_programs/should_fail/recursive_struct/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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
category = "fail" | ||
|
||
# check: $()recursive types are not supported | ||
|
||
# check: $()1 error. |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
script; | ||
library; | ||
|
||
enum E { | ||
Eins: F, | ||
|
@@ -39,7 +39,3 @@ enum Y { | |
struct Z { | ||
five: X, | ||
} | ||
|
||
fn main() { | ||
|
||
} |
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_programs/should_pass/language/associated_const_in_decls_of_other_constants/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 = "associated_const_in_decls_of_other_constants" | ||
source = "member" | ||
dependencies = ["std"] | ||
|
||
[[package]] | ||
name = "core" | ||
source = "path+from-root-8CB91B60FB2568E4" | ||
|
||
[[package]] | ||
name = "std" | ||
source = "path+from-root-8CB91B60FB2568E4" | ||
dependencies = ["core"] |
10 changes: 10 additions & 0 deletions
10
...test_programs/should_pass/language/associated_const_in_decls_of_other_constants/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,10 @@ | ||
[project] | ||
authors = ["Fuel Labs <contact@fuel.sh>"] | ||
entry = "main.sw" | ||
license = "Apache-2.0" | ||
name = "associated_const_in_decls_of_other_constants" | ||
implicit-std = false | ||
|
||
|
||
[dependencies] | ||
std = { path = "../../../../../../../sway-lib-std" } |
Oops, something went wrong.