Skip to content

Commit 82b5fec

Browse files
Add more tests
1 parent d389730 commit 82b5fec

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
contract A layout at 0x1234 {}
2+
3+
contract B is A {}
4+
5+
contract C is B layout at 0xABCD {}
6+
// ----
7+
// TypeError 8894: (32-50): Storage base location can only be specified in the most derived contract.
8+
// TypeError 8894: (52-87): Storage base location can only be specified in the most derived contract.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
contract A layout at 0x1234 {}
2+
3+
contract B is A {}
4+
5+
contract C is B {}
6+
// ----
7+
// TypeError 8894: (32-50): Storage base location can only be specified in the most derived contract.
8+
// TypeError 8894: (52-70): Storage base location can only be specified in the most derived contract.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
function f(uint x) returns (uint) { return x + 1; }
2+
contract A layout at f(2) {}
3+
// ----
4+
// TypeError 1139: (73-77): The contract base location must be an expression that can be evaluated at compilation time.
5+
// TypeError 6396: (73-77): Only number literals are accepted in the expression specifying the contract base storage location.

0 commit comments

Comments
 (0)