-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
73e3bf6
commit 794ea3d
Showing
7 changed files
with
148 additions
and
64 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
third_party/move/move-compiler-v2/tests/checking-lang-v1/v1-typing/refer_other_constants.exp
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 @@ | ||
|
||
Diagnostics: | ||
error: not supported before language version `2.0`: referring to other constants | ||
┌─ tests/checking-lang-v1/v1-typing/refer_other_constants.move:3:5 | ||
│ | ||
3 │ const X: u64 = Y; | ||
│ ^^^^^^^^^^^^^^^^^ |
14 changes: 14 additions & 0 deletions
14
...d_party/move/move-compiler-v2/tests/checking-lang-v1/v1-typing/refer_other_constants.move
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,14 @@ | ||
address 0x42 { | ||
module M { | ||
const X: u64 = Y; | ||
const Y: u64 = 0; | ||
|
||
public fun get_x(): u64 { | ||
X | ||
} | ||
|
||
public fun get_y(): u64 { | ||
Y | ||
} | ||
} | ||
} |
48 changes: 46 additions & 2 deletions
48
third_party/move/move-compiler-v2/tests/checking/typing/recursive_constant.exp
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,7 +1,51 @@ | ||
|
||
Diagnostics: | ||
error: Found recursive definition of a constant | ||
┌─ tests/checking/typing/recursive_constant.move:4:5 | ||
error: Found recursive definition of a constant X | ||
┌─ tests/checking/typing/recursive_constant.move:3:5 | ||
│ | ||
3 │ const X: u64 = Y; | ||
│ ^^^^^^^^^^^^^^^^^ | ||
│ │ | ||
│ X is defined | ||
4 │ const Y: u64 = X; | ||
│ ----------------- Y is defined | ||
|
||
error: Found recursive definition of a constant F | ||
┌─ tests/checking/typing/recursive_constant.move:6:5 | ||
│ | ||
6 │ const F: u64 = F; | ||
│ ^^^^^^^^^^^^^^^^^ | ||
│ │ | ||
│ F is defined | ||
|
||
error: Invalid expression in `const`. Constant folding failed due to incomplete evaluation | ||
┌─ tests/checking/typing/recursive_constant.move:8:8 | ||
│ | ||
8 │ Z + A | ||
│ ^^^^^ | ||
|
||
error: Invalid expression in `const`. Constant folding failed due to incomplete evaluation | ||
┌─ tests/checking/typing/recursive_constant.move:10:20 | ||
│ | ||
10 │ const A: u64 = B + C; | ||
│ ^^^^^ | ||
|
||
error: Found recursive definition of a constant A | ||
┌─ tests/checking/typing/recursive_constant.move:10:5 | ||
│ | ||
7 │ ╭ const X1: u64 = { | ||
8 │ │ Z + A | ||
9 │ │ }; | ||
│ ╰──────' X1 is defined | ||
10 │ const A: u64 = B + C; | ||
│ ^^^^^^^^^^^^^^^^^^^^^ | ||
│ │ | ||
│ A is defined | ||
11 │ const B: u64 = X1; | ||
│ ------------------ B is defined | ||
|
||
error: Invalid expression in `const`. Constant folding failed due to incomplete evaluation | ||
┌─ tests/checking/typing/recursive_constant.move:12:20 | ||
│ | ||
12 │ const C: u64 = Z + B; | ||
│ ^^^^^ |
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