Skip to content

Commit

Permalink
Add cmdline tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusaaguiar committed Jan 17, 2025
1 parent fca7d3f commit 8b303fb
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/cmdlineTests/storage_base_location_defined_ancestor/in.sol
Original file line number Diff line number Diff line change
@@ -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 {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"language": "Solidity",
"sources": {
"fileA": {"urls": ["storage_base_location_defined_ancestor/in.sol"]}
},
"settings": {
"outputSelection": {
"fileA": { "A": ["*"] }
}
}
}
Original file line number Diff line number Diff line change
@@ -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": {}
}

0 comments on commit 8b303fb

Please # to comment.