-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
c3a8217
commit 54451ed
Showing
8 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
test/libsolidity/syntaxTests/contractBaseLocation/abstract_contract.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,4 @@ | ||
abstract contract C layout at 0x123 { | ||
} | ||
// ---- | ||
// TypeError 7587: (30-35): Storage base location cannot be specified for abstract contracts or libraries |
8 changes: 8 additions & 0 deletions
8
...idity/syntaxTests/contractBaseLocation/layout_already_specified_in_ancestor_contract_.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,8 @@ | ||
contract A layout at 0x1234 {} | ||
|
||
contract B is A {} | ||
|
||
contract C is B layout at 0xABCD {} | ||
// ---- | ||
// TypeError 8894: (32-50): Storage base location can only be specified in the most derived contract. | ||
// TypeError 8894: (52-87): Storage base location can only be specified in the most derived contract. |
3 changes: 3 additions & 0 deletions
3
test/libsolidity/syntaxTests/contractBaseLocation/layout_fractional_number.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,3 @@ | ||
contract A layout at 3/2 {} | ||
// ---- | ||
// TypeError 1763: (21-24): Contract storage base location cannot be specified by a fractional number. |
8 changes: 8 additions & 0 deletions
8
...y/syntaxTests/contractBaseLocation/layout_not_specified_in_most_derived_contract_copy.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,8 @@ | ||
contract A layout at 0x1234 {} | ||
|
||
contract B is A {} | ||
|
||
contract C is B {} | ||
// ---- | ||
// TypeError 8894: (32-50): Storage base location can only be specified in the most derived contract. | ||
// TypeError 8894: (52-70): Storage base location can only be specified in the most derived contract. |
1 change: 1 addition & 0 deletions
1
...solidity/syntaxTests/contractBaseLocation/layout_specification_constant_in_expression.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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
uint constant X = 42; | ||
contract C layout at 0xffff * (50 - X) { } | ||
// ---- | ||
// TypeError 6396: (43-60): Only number literals are accepted in the expression specifying the contract base storage location. |
5 changes: 5 additions & 0 deletions
5
.../libsolidity/syntaxTests/contractBaseLocation/layout_specified_by_expression_not_pure.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 @@ | ||
function f(uint x) returns (uint) { return x + 1; } | ||
contract A layout at f(2) {} | ||
// ---- | ||
// TypeError 1139: (73-77): The contract base location must be an expression that can be evaluated at compilation time. | ||
// TypeError 6396: (73-77): Only number literals are accepted in the expression specifying the contract base storage location. |
5 changes: 5 additions & 0 deletions
5
test/libsolidity/syntaxTests/contractBaseLocation/library.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 @@ | ||
library L layout at 0x123 { | ||
function f() public pure { } | ||
} | ||
// ---- | ||
// TypeError 7587: (20-25): Storage base location cannot be specified for abstract contracts or libraries |
2 changes: 1 addition & 1 deletion
2
test/libsolidity/syntaxTests/contractBaseLocation/simple_layout.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
contract A layout at 0x1234 {} | ||
contract B layout at 1024 {} | ||
contract C layout at "C" {} | ||
contract C layout at 0 {} | ||
// ---- |