Skip to content

Commit 6204a59

Browse files
Add tests
1 parent 28cf388 commit 6204a59

5 files changed

+32
-6
lines changed

test/libsolidity/syntaxTests/storageLayoutSpecifier/layout_already_specified_in_ancestor_contract.sol

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ contract B is A {}
44

55
contract C is B layout at 0xABCD {}
66
// ----
7-
// TypeError 8894: (32-50): Storage layout can only be specified in the most derived contract.
8-
// TypeError 8894: (52-87): Storage layout can only be specified in the most derived contract.
7+
// TypeError 8894: (46-47): Storage layout can only be specified in the most derived contract.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
==== Source: M ====
2+
contract A layout at 0x1234 {}
3+
4+
==== Source: N ====
5+
contract A {}
6+
7+
==== Source: C ====
8+
import "M" as M;
9+
import "N" as N;
10+
11+
contract C is M.A, N.A layout at 0xABCD {}
12+
// ----
13+
// TypeError 8894: (C:49-52): Storage layout can only be specified in the most derived contract.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
contract A layout at 1 {}
2+
contract B is A layout at 2 {}
3+
4+
contract C1 is B {}
5+
contract C2 is A, B {}
6+
contract C3 is B {}
7+
8+
contract D1 is C1 {}
9+
contract D2 is C2 {}
10+
contract D3 is C3 {}
11+
// ----
12+
// TypeError 8894: (40-41): Storage layout can only be specified in the most derived contract.
13+
// TypeError 8894: (73-74): Storage layout can only be specified in the most derived contract.
14+
// TypeError 8894: (93-94): Storage layout can only be specified in the most derived contract.
15+
// TypeError 8894: (96-97): Storage layout can only be specified in the most derived contract.
16+
// TypeError 8894: (116-117): Storage layout can only be specified in the most derived contract.

test/libsolidity/syntaxTests/storageLayoutSpecifier/layout_specified_by_first_ancestor_contract.sol

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@ contract B is A {}
33
contract C is B {}
44
contract D is C {}
55
// ----
6-
// TypeError 8894: (27-45): Storage layout can only be specified in the most derived contract.
7-
// TypeError 8894: (46-64): Storage layout can only be specified in the most derived contract.
8-
// TypeError 8894: (65-83): Storage layout can only be specified in the most derived contract.
6+
// TypeError 8894: (41-42): Storage layout can only be specified in the most derived contract.

test/libsolidity/syntaxTests/storageLayoutSpecifier/layout_specified_by_last_ancestor_contract.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ contract B is A {}
33
contract C is B layout at 42 {}
44
contract D is C {}
55
// ----
6-
// TypeError 8894: (65-83): Storage layout can only be specified in the most derived contract.
6+
// TypeError 8894: (79-80): Storage layout can only be specified in the most derived contract.

0 commit comments

Comments
 (0)