diff --git a/test/cmdlineTests/storage_base_location_defined_ancestor/in.sol b/test/cmdlineTests/storage_base_location_defined_ancestor/in.sol new file mode 100644 index 000000000000..b73bff38d6a7 --- /dev/null +++ b/test/cmdlineTests/storage_base_location_defined_ancestor/in.sol @@ -0,0 +1,10 @@ +//SPDX-License-Identifier: GPL-3.0 +pragma solidity >=0.0; +contract A layout at 0x1234 { +} + +contract B is A { +} + +contract C layout at 0x1234 is B { +} \ No newline at end of file diff --git a/test/cmdlineTests/storage_base_location_defined_ancestor/input.json b/test/cmdlineTests/storage_base_location_defined_ancestor/input.json new file mode 100644 index 000000000000..fd7646d04d6c --- /dev/null +++ b/test/cmdlineTests/storage_base_location_defined_ancestor/input.json @@ -0,0 +1,11 @@ +{ + "language": "Solidity", + "sources": { + "fileA": {"urls": ["storage_base_location_defined_ancestor/in.sol"]} + }, + "settings": { + "outputSelection": { + "fileA": { "A": ["*"] } + } + } +} diff --git a/test/cmdlineTests/storage_base_location_defined_ancestor/output.json b/test/cmdlineTests/storage_base_location_defined_ancestor/output.json new file mode 100644 index 000000000000..d171543e6003 --- /dev/null +++ b/test/cmdlineTests/storage_base_location_defined_ancestor/output.json @@ -0,0 +1,69 @@ +{ + "errors": [ + { + "component": "general", + "errorCode": "8894", + "formattedMessage": "TypeError: Storage base location can only be specified in the most derived contract. + --> fileA:6:1: + | +6 | contract B is A { + | ^ (Relevant source part starts here and spans across multiple lines). +Note: Storage base location was already specified here. + --> fileA:3:22: + | +3 | contract A layout at 0x1234 { + | ^^^^^^ + +", + "message": "Storage base location can only be specified in the most derived contract.", + "secondarySourceLocations": [ + { + "end": 85, + "file": "fileA", + "message": "Storage base location was already specified here.", + "start": 79 + } + ], + "severity": "error", + "sourceLocation": { + "end": 110, + "file": "fileA", + "start": 91 + }, + "type": "TypeError" + }, + { + "component": "general", + "errorCode": "8894", + "formattedMessage": "TypeError: Storage base location can only be specified in the most derived contract. + --> fileA:9:1: + | +9 | contract C layout at 0x1234 is B { + | ^ (Relevant source part starts here and spans across multiple lines). +Note: Storage base location was already specified here. + --> fileA:3:22: + | +3 | contract A layout at 0x1234 { + | ^^^^^^ + +", + "message": "Storage base location can only be specified in the most derived contract.", + "secondarySourceLocations": [ + { + "end": 85, + "file": "fileA", + "message": "Storage base location was already specified here.", + "start": 79 + } + ], + "severity": "error", + "sourceLocation": { + "end": 148, + "file": "fileA", + "start": 112 + }, + "type": "TypeError" + } + ], + "sources": {} +}