forked from ethereum/solidity
-
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.
- Loading branch information
Showing
5 changed files
with
32 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
5 changes: 5 additions & 0 deletions
5
test/libsolidity/syntaxTests/constants/cyclic_dependency_1.sol
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,5 @@ | ||
contract C { | ||
uint constant a = a; | ||
} | ||
// ---- | ||
// TypeError: The value of the constant a has a cyclic dependency via a. |
10 changes: 10 additions & 0 deletions
10
test/libsolidity/syntaxTests/constants/cyclic_dependency_2.sol
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 @@ | ||
contract C { | ||
uint constant a = b * c; | ||
uint constant b = 7; | ||
uint constant c = b + uint(keccak256(d)); | ||
uint constant d = 2 + a; | ||
} | ||
// ---- | ||
// TypeError: The value of the constant a has a cyclic dependency via c. | ||
// TypeError: The value of the constant c has a cyclic dependency via d. | ||
// TypeError: The value of the constant d has a cyclic dependency via a. |
11 changes: 11 additions & 0 deletions
11
test/libsolidity/syntaxTests/constants/cyclic_dependency_3.sol
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 @@ | ||
contract C { | ||
uint constant x = a; | ||
uint constant a = b * c; | ||
uint constant b = c; | ||
uint constant c = b; | ||
} | ||
// ---- | ||
// TypeError: The value of the constant x has a cyclic dependency via a. | ||
// TypeError: The value of the constant a has a cyclic dependency via b. | ||
// TypeError: The value of the constant b has a cyclic dependency via c. | ||
// TypeError: The value of the constant c has a cyclic dependency via b. |
6 changes: 6 additions & 0 deletions
6
test/libsolidity/syntaxTests/constants/cyclic_dependency_4.sol
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 @@ | ||
contract C { | ||
uint constant a = b * c; | ||
uint constant b = 7; | ||
uint constant c = 4 + uint(keccak256(d)); | ||
uint constant d = 2 + b; | ||
} |