Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unreliable ASTJson tests #12696

Merged
merged 7 commits into from
Mar 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions test/libsolidity/ASTJSON/address_payable.json
Original file line number Diff line number Diff line change
Expand Up @@ -423,18 +423,19 @@
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "239:7:1",
"src": "239:8:1",
"typeDescriptions":
{
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
"typeIdentifier": "t_type$_t_address_payable_$",
"typeString": "type(address payable)"
},
"typeName":
{
"id": 31,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "239:7:1",
"src": "239:8:1",
"stateMutability": "payable",
"typeDescriptions": {}
}
},
Expand All @@ -450,8 +451,8 @@
"tryCall": false,
"typeDescriptions":
{
"typeIdentifier": "t_address",
"typeString": "address"
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "232:17:1",
Expand Down
2 changes: 1 addition & 1 deletion test/libsolidity/ASTJSON/address_payable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ contract C {
address payable a = m[arg];
r = arg;
address c = address(this);
m[c] = address(0);
m[c] = payable(0);
}
}

Expand Down
5 changes: 3 additions & 2 deletions test/libsolidity/ASTJSON/address_payable_parseOnly.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,14 +268,15 @@
{
"id": 32,
"nodeType": "ElementaryTypeNameExpression",
"src": "239:7:1",
"src": "239:8:1",
"typeDescriptions": {},
"typeName":
{
"id": 31,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "239:7:1",
"src": "239:8:1",
"stateMutability": "payable",
"typeDescriptions": {}
}
},
Expand Down
81 changes: 50 additions & 31 deletions test/libsolidity/ASTJSON/assembly/nested_functions.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"canonicalName": "C",
"contractDependencies": [],
"contractKind": "contract",
"fullyImplemented": true,
"id": 8,
"linearizedBaseContracts":
[
Expand All @@ -32,21 +33,21 @@
{
"id": 6,
"nodeType": "Block",
"src": "57:97:1",
"src": "57:95:1",
"statements":
[
{
"AST":
{
"nodeType": "YulBlock",
"src": "72:78:1",
"src": "72:76:1",
"statements":
[
{
"body":
{
"nodeType": "YulBlock",
"src": "94:50:1",
"src": "94:35:1",
"statements":
[
{
Expand All @@ -59,43 +60,53 @@
"name": "f2",
"nodeType": "YulFunctionDefinition",
"src": "104:17:1"
},
{
"nodeType": "YulAssignment",
"src": "130:6:1",
"value":
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "135:1:1",
"type": "",
"value": "2"
},
"variableNames":
[
{
"name": "x",
"nodeType": "YulIdentifier",
"src": "130:1:1"
}
]
}
]
},
"name": "f1",
"nodeType": "YulFunctionDefinition",
"src": "80:64:1"
"src": "80:49:1"
},
{
"nodeType": "YulAssignment",
"src": "136:6:1",
"value":
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "141:1:1",
"type": "",
"value": "2"
},
"variableNames":
[
{
"name": "x",
"nodeType": "YulIdentifier",
"src": "136:1:1"
}
]
}
]
},
"evmVersion": %EVMVERSION%,
"externalReferences": [],
"externalReferences":
[
{
"declaration": 3,
"isOffset": false,
"isSlot": false,
"src": "136:1:1",
"valueSize": 1
}
],
"id": 5,
"nodeType": "InlineAssembly",
"src": "63:87:1"
"src": "63:85:1"
}
]
},
"functionSelector": "26121ff0",
"id": 7,
"implemented": true,
"kind": "function",
Expand Down Expand Up @@ -127,31 +138,39 @@
"src": "49:6:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {},
"typeDescriptions":
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName":
{
"id": 2,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "49:4:1",
"typeDescriptions": {}
"typeDescriptions":
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "48:8:1"
},
"scope": 8,
"src": "15:139:1",
"src": "15:137:1",
"stateMutability": "pure",
"virtual": false,
"visibility": "public"
}
],
"scope": 9,
"src": "0:156:1",
"src": "0:154:1",
"usedErrors": []
}
],
"src": "0:157:1"
"src": "0:155:1"
}
2 changes: 1 addition & 1 deletion test/libsolidity/ASTJSON/assembly/nested_functions.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ contract C {
assembly {
function f1() {
function f2() { }
x := 2
}
x := 2
}
}
}
Expand Down
56 changes: 28 additions & 28 deletions test/libsolidity/ASTJSON/assembly/nested_functions_parseOnly.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@
{
"id": 6,
"nodeType": "Block",
"src": "57:97:1",
"src": "57:95:1",
"statements":
[
{
"AST":
{
"nodeType": "YulBlock",
"src": "72:78:1",
"src": "72:76:1",
"statements":
[
{
"body":
{
"nodeType": "YulBlock",
"src": "94:50:1",
"src": "94:35:1",
"statements":
[
{
Expand All @@ -47,40 +47,40 @@
"name": "f2",
"nodeType": "YulFunctionDefinition",
"src": "104:17:1"
},
{
"nodeType": "YulAssignment",
"src": "130:6:1",
"value":
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "135:1:1",
"type": "",
"value": "2"
},
"variableNames":
[
{
"name": "x",
"nodeType": "YulIdentifier",
"src": "130:1:1"
}
]
}
]
},
"name": "f1",
"nodeType": "YulFunctionDefinition",
"src": "80:64:1"
"src": "80:49:1"
},
{
"nodeType": "YulAssignment",
"src": "136:6:1",
"value":
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "141:1:1",
"type": "",
"value": "2"
},
"variableNames":
[
{
"name": "x",
"nodeType": "YulIdentifier",
"src": "136:1:1"
}
]
}
]
},
"evmVersion": %EVMVERSION%,
"externalReferences": [],
"id": 5,
"nodeType": "InlineAssembly",
"src": "63:87:1"
"src": "63:85:1"
}
]
},
Expand Down Expand Up @@ -128,15 +128,15 @@
],
"src": "48:8:1"
},
"src": "15:139:1",
"src": "15:137:1",
"stateMutability": "pure",
"virtual": false,
"visibility": "public"
}
],
"src": "0:156:1",
"src": "0:154:1",
"usedErrors": []
}
],
"src": "0:157:1"
"src": "0:155:1"
}
Loading