mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #13816 from quantum13/disallow_several_indexed_for_event_parameter
Disallow several `indexed` attributes for the same event parameter
This commit is contained in:
commit
d70d79af4a
@ -22,6 +22,8 @@ Compiler Features:
|
||||
|
||||
|
||||
Bugfixes:
|
||||
* Parser: Disallow several ``indexed`` attributes for the same event parameter.
|
||||
* Parser: Disallow usage of the ``indexed`` attribute for modifier parameters.
|
||||
* Yul Optimizer: Hash hex and decimal literals according to their value instead of their representation, improving the detection of equivalent functions.
|
||||
* Solidity Upgrade Tool ``solidity-upgrade``: Fix the tool returning success code on uncaught exceptions.
|
||||
* SMTChecker: Fix display error for negative integers that are one more than powers of two.
|
||||
|
@ -785,7 +785,12 @@ ASTPointer<VariableDeclaration> Parser::parseVariableDeclaration(
|
||||
else
|
||||
{
|
||||
if (_options.allowIndexed && token == Token::Indexed)
|
||||
{
|
||||
if (isIndexed)
|
||||
parserError(5399_error, "Indexed already specified.");
|
||||
|
||||
isIndexed = true;
|
||||
}
|
||||
else if (token == Token::Constant || token == Token::Immutable)
|
||||
{
|
||||
if (mutability != VariableDeclaration::Mutability::Mutable)
|
||||
@ -874,7 +879,6 @@ ASTPointer<ModifierDefinition> Parser::parseModifierDefinition()
|
||||
if (m_scanner->currentToken() == Token::LParen)
|
||||
{
|
||||
VarDeclParserOptions options;
|
||||
options.allowIndexed = true;
|
||||
options.allowLocationSpecifier = true;
|
||||
parameters = parseParameterList(options);
|
||||
}
|
||||
|
@ -0,0 +1,4 @@
|
||||
uint constant constant x;
|
||||
// ----
|
||||
// ParserError 3109: (14-22): Mutability already set to "constant"
|
||||
|
@ -0,0 +1,85 @@
|
||||
contract C {
|
||||
error a(bool payable);
|
||||
error b(string payable);
|
||||
error c(int payable);
|
||||
error d(int256 payable);
|
||||
error e(uint payable);
|
||||
error f(uint256 payable);
|
||||
error g(bytes1 payable);
|
||||
error h(bytes payable);
|
||||
error i(bytes32 payable);
|
||||
error j(fixed payable);
|
||||
error k(fixed80x80 payable);
|
||||
error l(ufixed payable);
|
||||
error m(ufixed80x80 payable);
|
||||
}
|
||||
contract C2 {
|
||||
error a(bool view);
|
||||
error b(string view);
|
||||
error c(int view);
|
||||
error d(int256 view);
|
||||
error e(uint view);
|
||||
error f(uint256 view);
|
||||
error g(bytes1 view);
|
||||
error h(bytes view);
|
||||
error i(bytes32 view);
|
||||
error j(fixed view);
|
||||
error k(fixed80x80 view);
|
||||
error l(ufixed view);
|
||||
error m(ufixed80x80 view);
|
||||
}
|
||||
contract C3 {
|
||||
error a(bool pure);
|
||||
error b(string pure);
|
||||
error c(int pure);
|
||||
error d(int256 pure);
|
||||
error e(uint pure);
|
||||
error f(uint256 pure);
|
||||
error g(bytes1 pure);
|
||||
error h(bytes pure);
|
||||
error i(bytes32 pure);
|
||||
error j(fixed pure);
|
||||
error k(fixed80x80 pure);
|
||||
error l(ufixed pure);
|
||||
error m(ufixed80x80 pure);
|
||||
}
|
||||
// ----
|
||||
// ParserError 9106: (30-37): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (59-66): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (85-92): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (114-121): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (141-148): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (171-178): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (200-207): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (228-235): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (258-265): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (286-293): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (319-326): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (348-355): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (382-389): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (425-429): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (451-455): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (474-478): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (500-504): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (524-528): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (551-555): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (577-581): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (602-606): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (629-633): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (654-658): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (684-688): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (710-714): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (741-745): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (781-785): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (807-811): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (830-834): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (856-860): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (880-884): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (907-911): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (933-937): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (958-962): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (985-989): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1010-1014): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1040-1044): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1066-1070): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1097-1101): State mutability can only be specified for address types.
|
@ -0,0 +1,5 @@
|
||||
contract C {
|
||||
error e1(uint indexed x);
|
||||
}
|
||||
// ----
|
||||
// ParserError 2314: (31-38): Expected ',' but got 'indexed'
|
@ -0,0 +1,16 @@
|
||||
==== Source: A ====
|
||||
contract test {
|
||||
error e1(string storage a);
|
||||
}
|
||||
==== Source: B ====
|
||||
contract test {
|
||||
error e1(string memory a);
|
||||
}
|
||||
==== Source: C ====
|
||||
contract test {
|
||||
error e1(string calldata a);
|
||||
}
|
||||
// ----
|
||||
// ParserError 2314: (A:36-43): Expected ',' but got 'storage'
|
||||
// ParserError 2314: (B:36-42): Expected ',' but got 'memory'
|
||||
// ParserError 2314: (C:36-44): Expected ',' but got 'calldata'
|
@ -0,0 +1,7 @@
|
||||
contract C {
|
||||
error e1(uint constant x);
|
||||
error e2(uint immutable x);
|
||||
}
|
||||
// ----
|
||||
// DeclarationError 1788: (26-41): The "constant" keyword can only be used for state variables or variables at file level.
|
||||
// DeclarationError 8297: (57-73): The "immutable" keyword can only be used for state variables.
|
@ -0,0 +1,21 @@
|
||||
==== Source: A ====
|
||||
contract C {
|
||||
error e1(uint external x);
|
||||
}
|
||||
==== Source: B ====
|
||||
contract C {
|
||||
error e1(uint internal x);
|
||||
}
|
||||
==== Source: C ====
|
||||
contract C {
|
||||
error e1(uint public x);
|
||||
}
|
||||
==== Source: D ====
|
||||
contract C {
|
||||
error e1(uint private x);
|
||||
}
|
||||
// ----
|
||||
// ParserError 2314: (A:31-39): Expected ',' but got 'external'
|
||||
// ParserError 2314: (B:31-39): Expected ',' but got 'internal'
|
||||
// ParserError 2314: (C:31-37): Expected ',' but got 'public'
|
||||
// ParserError 2314: (D:31-38): Expected ',' but got 'private'
|
@ -0,0 +1,5 @@
|
||||
contract c {
|
||||
event e(uint a) anonymous anonymous;
|
||||
}
|
||||
// ----
|
||||
// ParserError 2314: (43-52): Expected ';' but got 'anonymous'
|
@ -0,0 +1,85 @@
|
||||
contract C {
|
||||
event a(bool payable);
|
||||
event b(string payable);
|
||||
event c(int payable);
|
||||
event d(int256 payable);
|
||||
event e(uint payable);
|
||||
event f(uint256 payable);
|
||||
event g(bytes1 payable);
|
||||
event h(bytes payable);
|
||||
event i(bytes32 payable);
|
||||
event j(fixed payable);
|
||||
event k(fixed80x80 payable);
|
||||
event l(ufixed payable);
|
||||
event m(ufixed80x80 payable);
|
||||
}
|
||||
contract C2 {
|
||||
event a(bool view);
|
||||
event b(string view);
|
||||
event c(int view);
|
||||
event d(int256 view);
|
||||
event e(uint view);
|
||||
event f(uint256 view);
|
||||
event g(bytes1 view);
|
||||
event h(bytes view);
|
||||
event i(bytes32 view);
|
||||
event j(fixed view);
|
||||
event k(fixed80x80 view);
|
||||
event l(ufixed view);
|
||||
event m(ufixed80x80 view);
|
||||
}
|
||||
contract C3 {
|
||||
event a(bool pure);
|
||||
event b(string pure);
|
||||
event c(int pure);
|
||||
event d(int256 pure);
|
||||
event e(uint pure);
|
||||
event f(uint256 pure);
|
||||
event g(bytes1 pure);
|
||||
event h(bytes pure);
|
||||
event i(bytes32 pure);
|
||||
event j(fixed pure);
|
||||
event k(fixed80x80 pure);
|
||||
event l(ufixed pure);
|
||||
event m(ufixed80x80 pure);
|
||||
}
|
||||
// ----
|
||||
// ParserError 9106: (30-37): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (59-66): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (85-92): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (114-121): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (141-148): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (171-178): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (200-207): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (228-235): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (258-265): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (286-293): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (319-326): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (348-355): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (382-389): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (425-429): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (451-455): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (474-478): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (500-504): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (524-528): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (551-555): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (577-581): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (602-606): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (629-633): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (654-658): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (684-688): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (710-714): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (741-745): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (781-785): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (807-811): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (830-834): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (856-860): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (880-884): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (907-911): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (933-937): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (958-962): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (985-989): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1010-1014): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1040-1044): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1066-1070): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1097-1101): State mutability can only be specified for address types.
|
@ -0,0 +1,9 @@
|
||||
contract c {
|
||||
event e(uint indexed a, bytes3 indexed indexed s, bool indexed indexed indexed b);
|
||||
event e2(uint indexed indexed a, bytes3 indexed s);
|
||||
}
|
||||
// ----
|
||||
// ParserError 5399: (56-63): Indexed already specified.
|
||||
// ParserError 5399: (80-87): Indexed already specified.
|
||||
// ParserError 5399: (88-95): Indexed already specified.
|
||||
// ParserError 5399: (126-133): Indexed already specified.
|
@ -0,0 +1,16 @@
|
||||
==== Source: A ====
|
||||
contract test {
|
||||
event e1(string storage a);
|
||||
}
|
||||
==== Source: B ====
|
||||
contract test {
|
||||
event e1(string memory a);
|
||||
}
|
||||
==== Source: C ====
|
||||
contract test {
|
||||
event e1(string calldata a);
|
||||
}
|
||||
// ----
|
||||
// ParserError 2314: (A:36-43): Expected ',' but got 'storage'
|
||||
// ParserError 2314: (B:36-42): Expected ',' but got 'memory'
|
||||
// ParserError 2314: (C:36-44): Expected ',' but got 'calldata'
|
@ -0,0 +1,7 @@
|
||||
contract test {
|
||||
event e1(uint constant a);
|
||||
event e2(uint immutable a);
|
||||
}
|
||||
// ----
|
||||
// DeclarationError 1788: (29-44): The "constant" keyword can only be used for state variables or variables at file level.
|
||||
// DeclarationError 8297: (60-76): The "immutable" keyword can only be used for state variables.
|
@ -0,0 +1,21 @@
|
||||
==== Source: A ====
|
||||
contract test {
|
||||
event e1(uint external a);
|
||||
}
|
||||
==== Source: B ====
|
||||
contract test {
|
||||
event e1(uint internal a);
|
||||
}
|
||||
==== Source: C ====
|
||||
contract test {
|
||||
event e1(uint public a);
|
||||
}
|
||||
==== Source: D ====
|
||||
contract test {
|
||||
event e1(uint private a);
|
||||
}
|
||||
// ----
|
||||
// ParserError 2314: (A:34-42): Expected ',' but got 'external'
|
||||
// ParserError 2314: (B:34-42): Expected ',' but got 'internal'
|
||||
// ParserError 2314: (C:34-40): Expected ',' but got 'public'
|
||||
// ParserError 2314: (D:34-41): Expected ',' but got 'private'
|
@ -0,0 +1,85 @@
|
||||
contract C {
|
||||
modifier a(bool payable) {}
|
||||
modifier b(string payable) {}
|
||||
modifier c(int payable) {}
|
||||
modifier d(int256 payable) {}
|
||||
modifier e(uint payable) {}
|
||||
modifier f(uint256 payable) {}
|
||||
modifier g(bytes1 payable) {}
|
||||
modifier h(bytes payable) {}
|
||||
modifier i(bytes32 payable) {}
|
||||
modifier j(fixed payable) {}
|
||||
modifier k(fixed80x80 payable) {}
|
||||
modifier l(ufixed payable) {}
|
||||
modifier m(ufixed80x80 payable) {}
|
||||
}
|
||||
contract C2 {
|
||||
modifier a(bool view) {}
|
||||
modifier b(string view) {}
|
||||
modifier c(int view) {}
|
||||
modifier d(int256 view) {}
|
||||
modifier e(uint view) {}
|
||||
modifier f(uint256 view) {}
|
||||
modifier g(bytes1 view) {}
|
||||
modifier h(bytes view) {}
|
||||
modifier i(bytes32 view) {}
|
||||
modifier j(fixed view) {}
|
||||
modifier k(fixed80x80 view) {}
|
||||
modifier l(ufixed view) {}
|
||||
modifier m(ufixed80x80 view) {}
|
||||
}
|
||||
contract C3 {
|
||||
modifier a(bool pure) {}
|
||||
modifier b(string pure) {}
|
||||
modifier c(int pure) {}
|
||||
modifier d(int256 pure) {}
|
||||
modifier e(uint pure) {}
|
||||
modifier f(uint256 pure) {}
|
||||
modifier g(bytes1 pure) {}
|
||||
modifier h(bytes pure) {}
|
||||
modifier i(bytes32 pure) {}
|
||||
modifier j(fixed pure) {}
|
||||
modifier k(fixed80x80 pure) {}
|
||||
modifier l(ufixed pure) {}
|
||||
modifier m(ufixed80x80 pure) {}
|
||||
}
|
||||
// ----
|
||||
// ParserError 9106: (33-40): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (67-74): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (98-105): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (132-139): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (164-171): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (199-206): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (233-240): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (266-273): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (301-308): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (334-341): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (372-379): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (406-413): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (445-452): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (493-497): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (524-528): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (552-556): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (583-587): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (612-616): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (644-648): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (675-679): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (705-709): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (737-741): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (767-771): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (802-806): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (833-837): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (869-873): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (914-918): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (945-949): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (973-977): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1004-1008): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1033-1037): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1065-1069): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1096-1100): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1126-1130): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1158-1162): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1188-1192): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1223-1227): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1254-1258): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1290-1294): State mutability can only be specified for address types.
|
@ -0,0 +1,5 @@
|
||||
contract B {
|
||||
modifier mod1(uint indexed a) { _; }
|
||||
}
|
||||
// ----
|
||||
// ParserError 2314: (36-43): Expected ',' but got 'indexed'
|
@ -0,0 +1,7 @@
|
||||
contract A {
|
||||
modifier mod1(uint constant a) { _; }
|
||||
modifier mod2(uint immutable a) { _; }
|
||||
}
|
||||
// ----
|
||||
// DeclarationError 1788: (31-46): The "constant" keyword can only be used for state variables or variables at file level.
|
||||
// DeclarationError 8297: (73-89): The "immutable" keyword can only be used for state variables.
|
@ -0,0 +1,21 @@
|
||||
==== Source: A ====
|
||||
contract A {
|
||||
modifier mod(uint internal a) { _; }
|
||||
}
|
||||
==== Source: B ====
|
||||
contract A {
|
||||
modifier mod(uint external a) { _; }
|
||||
}
|
||||
==== Source: C ====
|
||||
contract A {
|
||||
modifier mod(uint public a) { _; }
|
||||
}
|
||||
==== Source: D ====
|
||||
contract A {
|
||||
modifier mod(uint private a) { _; }
|
||||
}
|
||||
// ----
|
||||
// ParserError 2314: (A:35-43): Expected ',' but got 'internal'
|
||||
// ParserError 2314: (B:35-43): Expected ',' but got 'external'
|
||||
// ParserError 2314: (C:35-41): Expected ',' but got 'public'
|
||||
// ParserError 2314: (D:35-42): Expected ',' but got 'private'
|
@ -0,0 +1,21 @@
|
||||
contract A {
|
||||
modifier mod1(string storage storage a) { _; }
|
||||
modifier mod2(string storage memory a) { _; }
|
||||
modifier mod3(string storage calldata a) { _; }
|
||||
modifier mod4(string memory storage a) { _; }
|
||||
modifier mod5(string memory memory a) { _; }
|
||||
modifier mod6(string memory calldata a) { _; }
|
||||
modifier mod7(string calldata storage a) { _; }
|
||||
modifier mod8(string calldata memory a) { _; }
|
||||
modifier mod9(string calldata calldata a) { _; }
|
||||
}
|
||||
// ----
|
||||
// ParserError 3548: (46-53): Location already specified.
|
||||
// ParserError 3548: (97-103): Location already specified.
|
||||
// ParserError 3548: (147-155): Location already specified.
|
||||
// ParserError 3548: (198-205): Location already specified.
|
||||
// ParserError 3548: (248-254): Location already specified.
|
||||
// ParserError 3548: (297-305): Location already specified.
|
||||
// ParserError 3548: (350-357): Location already specified.
|
||||
// ParserError 3548: (402-408): Location already specified.
|
||||
// ParserError 3548: (453-461): Location already specified.
|
@ -1,26 +1,50 @@
|
||||
contract C {
|
||||
address view m_a;
|
||||
address pure m_b;
|
||||
address view[] m_c;
|
||||
mapping(uint => address view) m_d;
|
||||
function f() public pure {
|
||||
address view a;
|
||||
address pure b;
|
||||
a; b;
|
||||
}
|
||||
function g(address view) public pure {}
|
||||
function h(address pure) public pure {}
|
||||
function i() public pure returns (address view) {}
|
||||
function j() public pure returns (address pure) {}
|
||||
address view m_a;
|
||||
address pure m_b;
|
||||
address view[] m_c;
|
||||
mapping(uint => address view) m_d;
|
||||
function f() public pure {
|
||||
address view a;
|
||||
address pure b;
|
||||
a; b;
|
||||
}
|
||||
function g(address view) public pure {}
|
||||
function h(address pure) public pure {}
|
||||
function i() public pure returns (address view) {}
|
||||
function j() public pure returns (address pure) {}
|
||||
modifier m1(address view) {_;}
|
||||
modifier m2(address pure) {_;}
|
||||
event e1(address view);
|
||||
event e2(address pure);
|
||||
error err1(address view);
|
||||
error err2(address pure);
|
||||
function f2() public pure returns (address) {
|
||||
try this.f2() returns (address view res) {} catch {}
|
||||
}
|
||||
function f3() public pure returns (address) {
|
||||
try this.f3() returns (address pure res) {} catch {}
|
||||
}
|
||||
}
|
||||
address view constant f_a;
|
||||
address pure constant f_b;
|
||||
// ----
|
||||
// TypeError 2311: (14-26): Address types can only be payable or non-payable.
|
||||
// TypeError 2311: (33-45): Address types can only be payable or non-payable.
|
||||
// TypeError 2311: (52-64): Address types can only be payable or non-payable.
|
||||
// TypeError 2311: (89-101): Address types can only be payable or non-payable.
|
||||
// TypeError 2311: (138-150): Address types can only be payable or non-payable.
|
||||
// TypeError 2311: (156-168): Address types can only be payable or non-payable.
|
||||
// TypeError 2311: (195-207): Address types can only be payable or non-payable.
|
||||
// TypeError 2311: (236-248): Address types can only be payable or non-payable.
|
||||
// TypeError 2311: (300-312): Address types can only be payable or non-payable.
|
||||
// TypeError 2311: (352-364): Address types can only be payable or non-payable.
|
||||
// TypeError 2311: (17-29): Address types can only be payable or non-payable.
|
||||
// TypeError 2311: (39-51): Address types can only be payable or non-payable.
|
||||
// TypeError 2311: (61-73): Address types can only be payable or non-payable.
|
||||
// TypeError 2311: (101-113): Address types can only be payable or non-payable.
|
||||
// TypeError 2311: (159-171): Address types can only be payable or non-payable.
|
||||
// TypeError 2311: (183-195): Address types can only be payable or non-payable.
|
||||
// TypeError 2311: (234-246): Address types can only be payable or non-payable.
|
||||
// TypeError 2311: (278-290): Address types can only be payable or non-payable.
|
||||
// TypeError 2311: (345-357): Address types can only be payable or non-payable.
|
||||
// TypeError 2311: (400-412): Address types can only be payable or non-payable.
|
||||
// TypeError 2311: (433-445): Address types can only be payable or non-payable.
|
||||
// TypeError 2311: (468-480): Address types can only be payable or non-payable.
|
||||
// TypeError 2311: (500-512): Address types can only be payable or non-payable.
|
||||
// TypeError 2311: (528-540): Address types can only be payable or non-payable.
|
||||
// TypeError 2311: (558-570): Address types can only be payable or non-payable.
|
||||
// TypeError 2311: (588-600): Address types can only be payable or non-payable.
|
||||
// TypeError 2311: (684-696): Address types can only be payable or non-payable.
|
||||
// TypeError 2311: (801-813): Address types can only be payable or non-payable.
|
||||
// TypeError 2311: (839-851): Address types can only be payable or non-payable.
|
||||
// TypeError 2311: (866-878): Address types can only be payable or non-payable.
|
||||
|
@ -1,29 +0,0 @@
|
||||
contract C {
|
||||
bool payable a;
|
||||
string payable b;
|
||||
int payable c;
|
||||
int256 payable d;
|
||||
uint payable e;
|
||||
uint256 payable f;
|
||||
bytes1 payable g;
|
||||
bytes payable h;
|
||||
bytes32 payable i;
|
||||
fixed payable j;
|
||||
fixed80x80 payable k;
|
||||
ufixed payable l;
|
||||
ufixed80x80 payable m;
|
||||
}
|
||||
// ----
|
||||
// ParserError 9106: (22-29): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (44-51): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (63-70): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (85-92): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (105-112): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (128-135): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (150-157): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (171-178): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (194-201): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (215-222): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (241-248): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (263-270): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (290-297): State mutability can only be specified for address types.
|
@ -1,29 +0,0 @@
|
||||
contract C {
|
||||
function a(bool payable) public pure {}
|
||||
function b(string payable) public pure {}
|
||||
function c(int payable) public pure {}
|
||||
function d(int256 payable) public pure {}
|
||||
function e(uint payable) public pure {}
|
||||
function f(uint256 payable) public pure {}
|
||||
function g(bytes1 payable) public pure {}
|
||||
function h(bytes payable) public pure {}
|
||||
function i(bytes32 payable) public pure {}
|
||||
function j(fixed payable) public pure {}
|
||||
function k(fixed80x80 payable) public pure {}
|
||||
function l(ufixed payable) public pure {}
|
||||
function m(ufixed80x80 payable) public pure {}
|
||||
}
|
||||
// ----
|
||||
// ParserError 9106: (33-40): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (79-86): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (122-129): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (168-175): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (212-219): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (259-266): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (305-312): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (350-357): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (397-404): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (442-449): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (492-499): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (538-545): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (589-596): State mutability can only be specified for address types.
|
@ -1,31 +0,0 @@
|
||||
contract C {
|
||||
function f() public pure {
|
||||
bool payable a;
|
||||
string payable b;
|
||||
int payable c;
|
||||
int256 payable d;
|
||||
uint payable e;
|
||||
uint256 payable f;
|
||||
bytes1 payable g;
|
||||
bytes payable h;
|
||||
bytes32 payable i;
|
||||
fixed payable j;
|
||||
fixed80x80 payable k;
|
||||
ufixed payable l;
|
||||
ufixed80x80 payable m;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// ParserError 9106: (57-64): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (83-90): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (106-113): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (132-139): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (156-163): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (183-190): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (209-216): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (234-241): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (261-268): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (286-293): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (316-323): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (342-349): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (373-380): State mutability can only be specified for address types.
|
@ -1,29 +0,0 @@
|
||||
contract C {
|
||||
function a() public pure returns (bool payable) {}
|
||||
function b() public pure returns (string payable) {}
|
||||
function c() public pure returns (int payable) {}
|
||||
function d() public pure returns (int256 payable) {}
|
||||
function e() public pure returns (uint payable) {}
|
||||
function f() public pure returns (uint256 payable) {}
|
||||
function g() public pure returns (bytes1 payable) {}
|
||||
function h() public pure returns (bytes payable) {}
|
||||
function i() public pure returns (bytes32 payable) {}
|
||||
function j() public pure returns (fixed payable) {}
|
||||
function k() public pure returns (fixed80x80 payable) {}
|
||||
function l() public pure returns (ufixed payable) {}
|
||||
function m() public pure returns (ufixed80x80 payable) {}
|
||||
}
|
||||
// ----
|
||||
// ParserError 9106: (56-63): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (113-120): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (167-174): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (224-231): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (279-286): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (337-344): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (394-401): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (450-457): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (508-515): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (564-571): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (625-632): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (682-689): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (744-751): State mutability can only be specified for address types.
|
@ -0,0 +1,85 @@
|
||||
contract C {
|
||||
function a(bool payable) public pure {}
|
||||
function b(string payable) public pure {}
|
||||
function c(int payable) public pure {}
|
||||
function d(int256 payable) public pure {}
|
||||
function e(uint payable) public pure {}
|
||||
function f(uint256 payable) public pure {}
|
||||
function g(bytes1 payable) public pure {}
|
||||
function h(bytes payable) public pure {}
|
||||
function i(bytes32 payable) public pure {}
|
||||
function j(fixed payable) public pure {}
|
||||
function k(fixed80x80 payable) public pure {}
|
||||
function l(ufixed payable) public pure {}
|
||||
function m(ufixed80x80 payable) public pure {}
|
||||
}
|
||||
contract C1 {
|
||||
function a(bool view) public pure {}
|
||||
function b(string view) public pure {}
|
||||
function c(int view) public pure {}
|
||||
function d(int256 view) public pure {}
|
||||
function e(uint view) public pure {}
|
||||
function f(uint256 view) public pure {}
|
||||
function g(bytes1 view) public pure {}
|
||||
function h(bytes view) public pure {}
|
||||
function i(bytes32 view) public pure {}
|
||||
function j(fixed view) public pure {}
|
||||
function k(fixed80x80 view) public pure {}
|
||||
function l(ufixed view) public pure {}
|
||||
function m(ufixed80x80 view) public pure {}
|
||||
}
|
||||
contract C2 {
|
||||
function a(bool pure) public pure {}
|
||||
function b(string pure) public pure {}
|
||||
function c(int pure) public pure {}
|
||||
function d(int256 pure) public pure {}
|
||||
function e(uint pure) public pure {}
|
||||
function f(uint256 pure) public pure {}
|
||||
function g(bytes1 pure) public pure {}
|
||||
function h(bytes pure) public pure {}
|
||||
function i(bytes32 pure) public pure {}
|
||||
function j(fixed pure) public pure {}
|
||||
function k(fixed80x80 pure) public pure {}
|
||||
function l(ufixed pure) public pure {}
|
||||
function m(ufixed80x80 pure) public pure {}
|
||||
}
|
||||
// ----
|
||||
// ParserError 9106: (33-40): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (79-86): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (122-129): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (168-175): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (212-219): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (259-266): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (305-312): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (350-357): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (397-404): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (442-449): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (492-499): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (538-545): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (589-596): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (649-653): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (692-696): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (732-736): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (775-779): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (816-820): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (860-864): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (903-907): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (945-949): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (989-993): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1031-1035): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1078-1082): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1121-1125): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1169-1173): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1226-1230): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1269-1273): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1309-1313): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1352-1356): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1393-1397): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1437-1441): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1480-1484): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1522-1526): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1566-1570): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1608-1612): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1655-1659): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1698-1702): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1746-1750): State mutability can only be specified for address types.
|
@ -0,0 +1,81 @@
|
||||
bool payable a;
|
||||
string payable b;
|
||||
int payable c;
|
||||
int256 payable d;
|
||||
uint payable e;
|
||||
uint256 payable f;
|
||||
bytes1 payable g;
|
||||
bytes payable h;
|
||||
bytes32 payable i;
|
||||
fixed payable j;
|
||||
fixed80x80 payable k;
|
||||
ufixed payable l;
|
||||
ufixed80x80 payable m;
|
||||
|
||||
bool view a2;
|
||||
string view b2;
|
||||
int view c2;
|
||||
int256 view d2;
|
||||
uint view e2;
|
||||
uint256 view f2;
|
||||
bytes1 view g2;
|
||||
bytes view h2;
|
||||
bytes32 view i2;
|
||||
fixed view j2;
|
||||
fixed80x80 view k2;
|
||||
ufixed view l2;
|
||||
ufixed80x80 view m2;
|
||||
|
||||
bool pure a3;
|
||||
string pure b3;
|
||||
int pure c3;
|
||||
int256 pure d3;
|
||||
uint pure e3;
|
||||
uint256 pure f3;
|
||||
bytes1 pure g3;
|
||||
bytes pure h3;
|
||||
bytes32 pure i3;
|
||||
fixed pure j3;
|
||||
fixed80x80 pure k3;
|
||||
ufixed pure l3;
|
||||
ufixed80x80 pure m3;
|
||||
// ----
|
||||
// ParserError 9106: (5-12): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (23-30): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (38-45): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (56-63): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (72-79): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (91-98): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (109-116): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (126-133): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (145-152): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (162-169): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (184-191): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (202-209): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (225-232): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (242-246): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (258-262): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (271-275): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (287-291): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (301-305): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (318-322): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (334-338): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (349-353): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (366-370): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (381-385): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (401-405): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (417-421): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (438-442): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (453-457): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (469-473): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (482-486): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (498-502): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (512-516): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (529-533): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (545-549): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (560-564): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (577-581): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (592-596): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (612-616): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (628-632): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (649-653): State mutability can only be specified for address types.
|
@ -0,0 +1,91 @@
|
||||
contract C {
|
||||
function f() public pure {
|
||||
bool payable a;
|
||||
string payable b;
|
||||
int payable c;
|
||||
int256 payable d;
|
||||
uint payable e;
|
||||
uint256 payable f;
|
||||
bytes1 payable g;
|
||||
bytes payable h;
|
||||
bytes32 payable i;
|
||||
fixed payable j;
|
||||
fixed80x80 payable k;
|
||||
ufixed payable l;
|
||||
ufixed80x80 payable m;
|
||||
}
|
||||
}
|
||||
contract C2 {
|
||||
function f() public pure {
|
||||
bool view a;
|
||||
string view b;
|
||||
int view c;
|
||||
int256 view d;
|
||||
uint view e;
|
||||
uint256 view f;
|
||||
bytes1 view g;
|
||||
bytes view h;
|
||||
bytes32 view i;
|
||||
fixed view j;
|
||||
fixed80x80 view k;
|
||||
ufixed view l;
|
||||
ufixed80x80 view m;
|
||||
}
|
||||
}
|
||||
contract C3 {
|
||||
function f() public pure {
|
||||
bool pure a;
|
||||
string pure b;
|
||||
int pure c;
|
||||
int256 pure d;
|
||||
uint pure e;
|
||||
uint256 pure f;
|
||||
bytes1 pure g;
|
||||
bytes pure h;
|
||||
bytes32 pure i;
|
||||
fixed pure j;
|
||||
fixed80x80 pure k;
|
||||
ufixed pure l;
|
||||
ufixed80x80 pure m;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// ParserError 9106: (57-64): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (83-90): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (106-113): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (132-139): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (156-163): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (183-190): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (209-216): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (234-241): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (261-268): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (286-293): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (316-323): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (342-349): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (373-380): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (450-454): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (473-477): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (493-497): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (516-520): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (537-541): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (561-565): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (584-588): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (606-610): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (630-634): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (652-656): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (679-683): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (702-706): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (730-734): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (804-808): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (827-831): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (847-851): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (870-874): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (891-895): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (915-919): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (938-942): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (960-964): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (984-988): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1006-1010): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1033-1037): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1056-1060): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1084-1088): State mutability can only be specified for address types.
|
@ -0,0 +1,85 @@
|
||||
contract C {
|
||||
function a() public pure returns (bool payable) {}
|
||||
function b() public pure returns (string payable) {}
|
||||
function c() public pure returns (int payable) {}
|
||||
function d() public pure returns (int256 payable) {}
|
||||
function e() public pure returns (uint payable) {}
|
||||
function f() public pure returns (uint256 payable) {}
|
||||
function g() public pure returns (bytes1 payable) {}
|
||||
function h() public pure returns (bytes payable) {}
|
||||
function i() public pure returns (bytes32 payable) {}
|
||||
function j() public pure returns (fixed payable) {}
|
||||
function k() public pure returns (fixed80x80 payable) {}
|
||||
function l() public pure returns (ufixed payable) {}
|
||||
function m() public pure returns (ufixed80x80 payable) {}
|
||||
}
|
||||
contract C1 {
|
||||
function a() public pure returns (bool view) {}
|
||||
function b() public pure returns (string view) {}
|
||||
function c() public pure returns (int view) {}
|
||||
function d() public pure returns (int256 view) {}
|
||||
function e() public pure returns (uint view) {}
|
||||
function f() public pure returns (uint256 view) {}
|
||||
function g() public pure returns (bytes1 view) {}
|
||||
function h() public pure returns (bytes view) {}
|
||||
function i() public pure returns (bytes32 view) {}
|
||||
function j() public pure returns (fixed view) {}
|
||||
function k() public pure returns (fixed80x80 view) {}
|
||||
function l() public pure returns (ufixed view) {}
|
||||
function m() public pure returns (ufixed80x80 view) {}
|
||||
}
|
||||
contract C2 {
|
||||
function a() public pure returns (bool pure) {}
|
||||
function b() public pure returns (string pure) {}
|
||||
function c() public pure returns (int pure) {}
|
||||
function d() public pure returns (int256 pure) {}
|
||||
function e() public pure returns (uint pure) {}
|
||||
function f() public pure returns (uint256 pure) {}
|
||||
function g() public pure returns (bytes1 pure) {}
|
||||
function h() public pure returns (bytes pure) {}
|
||||
function i() public pure returns (bytes32 pure) {}
|
||||
function j() public pure returns (fixed pure) {}
|
||||
function k() public pure returns (fixed80x80 pure) {}
|
||||
function l() public pure returns (ufixed pure) {}
|
||||
function m() public pure returns (ufixed80x80 pure) {}
|
||||
}
|
||||
// ----
|
||||
// ParserError 9106: (56-63): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (113-120): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (167-174): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (224-231): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (279-286): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (337-344): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (394-401): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (450-457): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (508-515): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (564-571): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (625-632): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (682-689): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (744-751): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (815-819): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (869-873): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (920-924): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (974-978): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1026-1030): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1081-1085): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1135-1139): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1188-1192): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1243-1247): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1296-1300): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1354-1358): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1408-1412): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1467-1471): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1535-1539): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1589-1593): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1640-1644): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1694-1698): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1746-1750): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1801-1805): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1855-1859): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1908-1912): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1963-1967): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (2016-2020): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (2074-2078): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (2128-2132): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (2187-2191): State mutability can only be specified for address types.
|
@ -0,0 +1,85 @@
|
||||
contract C {
|
||||
bool payable a;
|
||||
string payable b;
|
||||
int payable c;
|
||||
int256 payable d;
|
||||
uint payable e;
|
||||
uint256 payable f;
|
||||
bytes1 payable g;
|
||||
bytes payable h;
|
||||
bytes32 payable i;
|
||||
fixed payable j;
|
||||
fixed80x80 payable k;
|
||||
ufixed payable l;
|
||||
ufixed80x80 payable m;
|
||||
}
|
||||
contract C2 {
|
||||
bool view a;
|
||||
string view b;
|
||||
int view c;
|
||||
int256 view d;
|
||||
uint view e;
|
||||
uint256 view f;
|
||||
bytes1 view g;
|
||||
bytes view h;
|
||||
bytes32 view i;
|
||||
fixed view j;
|
||||
fixed80x80 view k;
|
||||
ufixed view l;
|
||||
ufixed80x80 view m;
|
||||
}
|
||||
contract C3 {
|
||||
bool pure a;
|
||||
string pure b;
|
||||
int pure c;
|
||||
int256 pure d;
|
||||
uint pure e;
|
||||
uint256 pure f;
|
||||
bytes1 pure g;
|
||||
bytes pure h;
|
||||
bytes32 pure i;
|
||||
fixed pure j;
|
||||
fixed80x80 pure k;
|
||||
ufixed pure l;
|
||||
ufixed80x80 pure m;
|
||||
}
|
||||
// ----
|
||||
// ParserError 9106: (22-29): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (44-51): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (63-70): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (85-92): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (105-112): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (128-135): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (150-157): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (171-178): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (194-201): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (215-222): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (241-248): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (263-270): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (290-297): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (326-330): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (345-349): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (361-365): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (380-384): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (397-401): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (417-421): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (436-440): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (454-458): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (474-478): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (492-496): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (515-519): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (534-538): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (558-562): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (591-595): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (610-614): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (626-630): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (645-649): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (662-666): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (682-686): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (701-705): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (719-723): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (739-743): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (757-761): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (780-784): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (799-803): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (823-827): State mutability can only be specified for address types.
|
@ -0,0 +1,11 @@
|
||||
==== Source: A ====
|
||||
contract test {
|
||||
function f1(uint indexed a) public returns (uint) { }
|
||||
}
|
||||
==== Source: B ====
|
||||
contract test {
|
||||
function f1(uint a) public returns (uint indexed) { }
|
||||
}
|
||||
// ----
|
||||
// ParserError 2314: (A:37-44): Expected ',' but got 'indexed'
|
||||
// ParserError 2314: (B:61-68): Expected ',' but got 'indexed'
|
@ -0,0 +1,9 @@
|
||||
contract test {
|
||||
function f1(uint immutable a) public returns (uint immutable) { }
|
||||
function f2(uint constant a) public returns (uint constant) { }
|
||||
}
|
||||
// ----
|
||||
// DeclarationError 8297: (32-48): The "immutable" keyword can only be used for state variables.
|
||||
// DeclarationError 8297: (66-80): The "immutable" keyword can only be used for state variables.
|
||||
// DeclarationError 1788: (102-117): The "constant" keyword can only be used for state variables or variables at file level.
|
||||
// DeclarationError 1788: (135-148): The "constant" keyword can only be used for state variables or variables at file level.
|
@ -0,0 +1,11 @@
|
||||
==== Source: A ====
|
||||
contract test {
|
||||
string memory a;
|
||||
}
|
||||
==== Source: B ====
|
||||
contract test {
|
||||
string calldata a;
|
||||
}
|
||||
// ----
|
||||
// ParserError 2314: (A:27-33): Expected identifier but got 'memory'
|
||||
// ParserError 2314: (B:27-35): Expected identifier but got 'calldata'
|
@ -0,0 +1,16 @@
|
||||
==== Source: A ====
|
||||
uint indexed a;
|
||||
==== Source: B ====
|
||||
contract test {
|
||||
function f(uint a) public {
|
||||
uint indexed a;
|
||||
}
|
||||
}
|
||||
==== Source: C ====
|
||||
contract test {
|
||||
uint indexed a;
|
||||
}
|
||||
// ----
|
||||
// ParserError 2314: (A:5-12): Expected identifier but got 'indexed'
|
||||
// ParserError 2314: (B:61-68): Expected ';' but got 'indexed'
|
||||
// ParserError 2314: (C:25-32): Expected identifier but got 'indexed'
|
@ -0,0 +1,15 @@
|
||||
==== Source: A ====
|
||||
contract test {
|
||||
function f(uint a) public {
|
||||
uint constant a;
|
||||
}
|
||||
}
|
||||
==== Source: B ====
|
||||
contract test {
|
||||
function f(uint a) public {
|
||||
uint immutable a;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// ParserError 2314: (A:61-69): Expected ';' but got 'constant'
|
||||
// ParserError 2314: (B:61-70): Expected ';' but got 'immutable'
|
@ -0,0 +1,10 @@
|
||||
==== Source: A ====
|
||||
uint[] storage a;
|
||||
==== Source: B ====
|
||||
uint[] memory b;
|
||||
==== Source: C ====
|
||||
uint[] calldata c;
|
||||
// ----
|
||||
// ParserError 2314: (A:7-14): Expected identifier but got 'storage'
|
||||
// ParserError 2314: (B:7-13): Expected identifier but got 'memory'
|
||||
// ParserError 2314: (C:7-15): Expected identifier but got 'calldata'
|
@ -0,0 +1,21 @@
|
||||
contract Foo {
|
||||
function f1() returns (string calldata calldata) {}
|
||||
function f2() returns (string calldata memory) {}
|
||||
function f3() returns (string calldata storage) {}
|
||||
function f4() returns (string memory calldata) {}
|
||||
function f5() returns (string memory memory) {}
|
||||
function f6() returns (string memory storage) {}
|
||||
function f7() returns (string storage calldata) {}
|
||||
function f8() returns (string storage memory) {}
|
||||
function f9() returns (string storage storage) {}
|
||||
}
|
||||
// ----
|
||||
// ParserError 3548: (58-66): Location already specified.
|
||||
// ParserError 3548: (114-120): Location already specified.
|
||||
// ParserError 3548: (168-175): Location already specified.
|
||||
// ParserError 3548: (221-229): Location already specified.
|
||||
// ParserError 3548: (275-281): Location already specified.
|
||||
// ParserError 3548: (327-334): Location already specified.
|
||||
// ParserError 3548: (381-389): Location already specified.
|
||||
// ParserError 3548: (436-442): Location already specified.
|
||||
// ParserError 3548: (489-496): Location already specified.
|
@ -3,6 +3,14 @@ contract Foo {
|
||||
function f() public view {
|
||||
uint[] storage memory x = m_x;
|
||||
uint[] memory storage calldata y;
|
||||
uint[] storage calldata x2;
|
||||
uint[] storage storage x3;
|
||||
uint[] calldata memory x4;
|
||||
uint[] calldata calldata x5;
|
||||
uint[] calldata storage x6;
|
||||
uint[] storage memory x4;
|
||||
uint[] storage calldata x5;
|
||||
uint[] storage storage x6;
|
||||
x; y;
|
||||
}
|
||||
}
|
||||
@ -10,3 +18,11 @@ contract Foo {
|
||||
// ParserError 3548: (85-91): Location already specified.
|
||||
// ParserError 3548: (123-130): Location already specified.
|
||||
// ParserError 3548: (131-139): Location already specified.
|
||||
// ParserError 3548: (166-174): Location already specified.
|
||||
// ParserError 3548: (202-209): Location already specified.
|
||||
// ParserError 3548: (238-244): Location already specified.
|
||||
// ParserError 3548: (273-281): Location already specified.
|
||||
// ParserError 3548: (310-317): Location already specified.
|
||||
// ParserError 3548: (345-351): Location already specified.
|
||||
// ParserError 3548: (379-387): Location already specified.
|
||||
// ParserError 3548: (415-422): Location already specified.
|
||||
|
@ -1,6 +1,20 @@
|
||||
contract Foo {
|
||||
function f(uint[] storage memory constant x, uint[] memory calldata y) internal { }
|
||||
function f2(uint[] storage storage x) internal { }
|
||||
function f3(uint[] storage calldata x) internal { }
|
||||
function f4(uint[] memory storage x) internal { }
|
||||
function f5(uint[] memory memory x) internal { }
|
||||
function f6(uint[] calldata storage x) internal { }
|
||||
function f7(uint[] calldata memory x) internal { }
|
||||
function f8(uint[] calldata calldata x) internal { }
|
||||
}
|
||||
// ----
|
||||
// ParserError 3548: (45-51): Location already specified.
|
||||
// ParserError 3548: (78-86): Location already specified.
|
||||
// ParserError 3548: (134-141): Location already specified.
|
||||
// ParserError 3548: (189-197): Location already specified.
|
||||
// ParserError 3548: (244-251): Location already specified.
|
||||
// ParserError 3548: (298-304): Location already specified.
|
||||
// ParserError 3548: (353-360): Location already specified.
|
||||
// ParserError 3548: (409-415): Location already specified.
|
||||
// ParserError 3548: (464-472): Location already specified.
|
||||
|
@ -1,5 +1,11 @@
|
||||
==== Source: A ====
|
||||
contract Foo {
|
||||
uint[] memory storage calldata x;
|
||||
}
|
||||
==== Source: B ====
|
||||
contract Foo {
|
||||
uint[] storage storage x;
|
||||
}
|
||||
// ----
|
||||
// ParserError 2314: (23-29): Expected identifier but got 'memory'
|
||||
// ParserError 2314: (A:23-29): Expected identifier but got 'memory'
|
||||
// ParserError 2314: (B:23-30): Expected identifier but got 'storage'
|
@ -0,0 +1,11 @@
|
||||
contract C {
|
||||
uint constant constant a;
|
||||
uint immutable immutable b;
|
||||
uint constant immutable c;
|
||||
uint immutable constant d;
|
||||
}
|
||||
// ----
|
||||
// ParserError 3109: (31-39): Mutability already set to "constant"
|
||||
// ParserError 3109: (62-71): Mutability already set to "immutable"
|
||||
// ParserError 3109: (93-102): Mutability already set to "constant"
|
||||
// ParserError 3109: (125-133): Mutability already set to "immutable"
|
@ -0,0 +1,103 @@
|
||||
==== Source: A ====
|
||||
contract c1 {
|
||||
function f() payable payable {}
|
||||
}
|
||||
contract c2 {
|
||||
function f() view view {}
|
||||
}
|
||||
contract c3 {
|
||||
function f() pure pure {}
|
||||
}
|
||||
contract c4 {
|
||||
function f() pure view {}
|
||||
}
|
||||
contract c5 {
|
||||
function f() payable view {}
|
||||
}
|
||||
contract c6 {
|
||||
function f() pure payable {}
|
||||
}
|
||||
contract c7 {
|
||||
function f() view payable {}
|
||||
}
|
||||
contract c8 {
|
||||
function f() payable pure {}
|
||||
}
|
||||
contract c9 {
|
||||
function f() view pure {}
|
||||
}
|
||||
==== Source: B ====
|
||||
contract c {
|
||||
address payable payable v;
|
||||
}
|
||||
==== Source: C ====
|
||||
contract c {
|
||||
function fn(address payable payable) public { }
|
||||
}
|
||||
==== Source: D ====
|
||||
contract c {
|
||||
function fn() public returns (address payable payable) { }
|
||||
}
|
||||
==== Source: E ====
|
||||
contract c {
|
||||
function fn() public {
|
||||
address payable payable v;
|
||||
}
|
||||
}
|
||||
==== Source: F ====
|
||||
contract c {
|
||||
function fn(address payable payable v) public { }
|
||||
}
|
||||
==== Source: G ====
|
||||
contract c {
|
||||
function fn() public returns (address payable payable res) { }
|
||||
}
|
||||
==== Source: H ====
|
||||
address payable payable v;
|
||||
==== Source: I ====
|
||||
contract c {
|
||||
modifier m(address payable payable x) { _; }
|
||||
}
|
||||
==== Source: J ====
|
||||
contract c {
|
||||
event e(address payable payable x);
|
||||
}
|
||||
==== Source: K ====
|
||||
contract c {
|
||||
error e1(address payable payable x);
|
||||
}
|
||||
==== Source: L ====
|
||||
contract c {
|
||||
function f() public returns (address payable) {
|
||||
try this.f() returns (address payable payable) { } catch { }
|
||||
}
|
||||
}
|
||||
==== Source: M ====
|
||||
contract c {
|
||||
function f() public returns (address payable) {
|
||||
try this.f() returns (address payable) { } catch Error(address payable payable) { }
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// ParserError 9680: (A:39-46): State mutability already specified as "payable".
|
||||
// ParserError 9680: (A:88-92): State mutability already specified as "view".
|
||||
// ParserError 9680: (A:134-138): State mutability already specified as "pure".
|
||||
// ParserError 9680: (A:180-184): State mutability already specified as "pure".
|
||||
// ParserError 9680: (A:229-233): State mutability already specified as "payable".
|
||||
// ParserError 9680: (A:275-282): State mutability already specified as "pure".
|
||||
// ParserError 9680: (A:324-331): State mutability already specified as "view".
|
||||
// ParserError 9680: (A:376-380): State mutability already specified as "payable".
|
||||
// ParserError 9680: (A:422-426): State mutability already specified as "view".
|
||||
// ParserError 2314: (B:33-40): Expected identifier but got 'payable'
|
||||
// ParserError 2314: (C:45-52): Expected ',' but got 'payable'
|
||||
// ParserError 2314: (D:63-70): Expected ',' but got 'payable'
|
||||
// ParserError 2314: (E:64-71): Expected identifier but got 'payable'
|
||||
// ParserError 2314: (F:45-52): Expected ',' but got 'payable'
|
||||
// ParserError 2314: (G:63-70): Expected ',' but got 'payable'
|
||||
// ParserError 2314: (H:16-23): Expected identifier but got 'payable'
|
||||
// ParserError 2314: (I:44-51): Expected ',' but got 'payable'
|
||||
// ParserError 2314: (J:41-48): Expected ',' but got 'payable'
|
||||
// ParserError 2314: (K:42-49): Expected ',' but got 'payable'
|
||||
// ParserError 2314: (L:111-118): Expected ',' but got 'payable'
|
||||
// ParserError 2314: (M:144-151): Expected ',' but got 'payable'
|
||||
|
@ -1,29 +0,0 @@
|
||||
contract c1 {
|
||||
function f() payable payable {}
|
||||
}
|
||||
contract c2 {
|
||||
function f() view view {}
|
||||
}
|
||||
contract c3 {
|
||||
function f() pure pure {}
|
||||
}
|
||||
contract c4 {
|
||||
function f() pure view {}
|
||||
}
|
||||
contract c5 {
|
||||
function f() payable view {}
|
||||
}
|
||||
contract c6 {
|
||||
function f() pure payable {}
|
||||
}
|
||||
contract c7 {
|
||||
function f() view payable {}
|
||||
}
|
||||
// ----
|
||||
// ParserError 9680: (39-46): State mutability already specified as "payable".
|
||||
// ParserError 9680: (88-92): State mutability already specified as "view".
|
||||
// ParserError 9680: (134-138): State mutability already specified as "pure".
|
||||
// ParserError 9680: (180-184): State mutability already specified as "pure".
|
||||
// ParserError 9680: (229-233): State mutability already specified as "payable".
|
||||
// ParserError 9680: (275-282): State mutability already specified as "pure".
|
||||
// ParserError 9680: (324-331): State mutability already specified as "view".
|
@ -1,7 +0,0 @@
|
||||
contract C {
|
||||
uint private internal a;
|
||||
function f() private external {}
|
||||
}
|
||||
// ----
|
||||
// ParserError 4110: (30-38): Visibility already specified as "private".
|
||||
// ParserError 9439: (67-75): Visibility already specified as "private".
|
@ -1,5 +0,0 @@
|
||||
contract test {
|
||||
uint payable x;
|
||||
}
|
||||
// ----
|
||||
// ParserError 9106: (22-29): State mutability can only be specified for address types.
|
@ -0,0 +1,4 @@
|
||||
pragma experimental experimental __test;
|
||||
// ----
|
||||
// SyntaxError 6022: (0-40): Stray arguments.
|
||||
|
@ -0,0 +1,31 @@
|
||||
contract C {
|
||||
function a() public pure {
|
||||
try this.a() {} catch (string payable memory) {}
|
||||
}
|
||||
function c() public pure {
|
||||
try this.c() {} catch (bytes payable memory) {}
|
||||
}
|
||||
}
|
||||
contract C2 {
|
||||
function a() public pure {
|
||||
try this.a() {} catch (string view memory) {}
|
||||
}
|
||||
function c() public pure {
|
||||
try this.c() {} catch (bytes view memory) {}
|
||||
}
|
||||
}
|
||||
contract C3 {
|
||||
function a() public pure {
|
||||
try this.a() {} catch (string pure memory) {}
|
||||
}
|
||||
function c() public pure {
|
||||
try this.c() {} catch (bytes pure memory) {}
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// ParserError 9106: (82-89): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (175-182): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (285-289): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (375-379): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (482-486): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (572-576): State mutability can only be specified for address types.
|
@ -0,0 +1,163 @@
|
||||
contract C {
|
||||
function a() public pure returns (bool) {
|
||||
try this.a() returns (bool payable res) {} catch {}
|
||||
}
|
||||
function b() public pure returns (string) {
|
||||
try this.b() returns (string payable res) {} catch {}
|
||||
}
|
||||
function c() public pure returns (int) {
|
||||
try this.c() returns (int payable res) {} catch {}
|
||||
}
|
||||
function d() public pure returns (int256) {
|
||||
try this.d() returns (int256 payable res) {} catch {}
|
||||
}
|
||||
function e() public pure returns (uint) {
|
||||
try this.e() returns (uint payable res) {} catch {}
|
||||
}
|
||||
function f() public pure returns (uint256) {
|
||||
try this.f() returns (uint256 payable res) {} catch {}
|
||||
}
|
||||
function g() public pure returns (bytes1) {
|
||||
try this.g() returns (bytes1 payable res) {} catch {}
|
||||
}
|
||||
function h() public pure returns (bytes) {
|
||||
try this.h() returns (bytes payable res) {} catch {}
|
||||
}
|
||||
function i() public pure returns (bytes32) {
|
||||
try this.i() returns (bytes32 payable res) {} catch {}
|
||||
}
|
||||
function j() public pure returns (fixed) {
|
||||
try this.j() returns (fixed payable res) {} catch {}
|
||||
}
|
||||
function k() public pure returns (fixed80x80) {
|
||||
try this.k() returns (fixed80x80 payable res) {} catch {}
|
||||
}
|
||||
function l() public pure returns (ufixed) {
|
||||
try this.l() returns (ufixed payable res) {} catch {}
|
||||
}
|
||||
function m() public pure returns (ufixed80x80) {
|
||||
try this.m() returns (ufixed80x80 payable res) {} catch {}
|
||||
}
|
||||
}
|
||||
contract C1 {
|
||||
function a() public pure returns (bool) {
|
||||
try this.a() returns (bool view res) {} catch {}
|
||||
}
|
||||
function b() public pure returns (string) {
|
||||
try this.b() returns (string view res) {} catch {}
|
||||
}
|
||||
function c() public pure returns (int) {
|
||||
try this.c() returns (int view res) {} catch {}
|
||||
}
|
||||
function d() public pure returns (int256) {
|
||||
try this.d() returns (int256 view res) {} catch {}
|
||||
}
|
||||
function e() public pure returns (uint) {
|
||||
try this.e() returns (uint view res) {} catch {}
|
||||
}
|
||||
function f() public pure returns (uint256) {
|
||||
try this.f() returns (uint256 view res) {} catch {}
|
||||
}
|
||||
function g() public pure returns (bytes1) {
|
||||
try this.g() returns (bytes1 view res) {} catch {}
|
||||
}
|
||||
function h() public pure returns (bytes) {
|
||||
try this.h() returns (bytes view res) {} catch {}
|
||||
}
|
||||
function i() public pure returns (bytes32) {
|
||||
try this.i() returns (bytes32 view res) {} catch {}
|
||||
}
|
||||
function j() public pure returns (fixed) {
|
||||
try this.j() returns (fixed view res) {} catch {}
|
||||
}
|
||||
function k() public pure returns (fixed80x80) {
|
||||
try this.k() returns (fixed80x80 view res) {} catch {}
|
||||
}
|
||||
function l() public pure returns (ufixed) {
|
||||
try this.l() returns (ufixed view res) {} catch {}
|
||||
}
|
||||
function m() public pure returns (ufixed80x80) {
|
||||
try this.m() returns (ufixed80x80 view res) {} catch {}
|
||||
}
|
||||
}
|
||||
contract C2 {
|
||||
function a() public pure returns (bool) {
|
||||
try this.a() returns (bool pure res) {} catch {}
|
||||
}
|
||||
function b() public pure returns (string) {
|
||||
try this.b() returns (string pure res) {} catch {}
|
||||
}
|
||||
function c() public pure returns (int) {
|
||||
try this.c() returns (int pure res) {} catch {}
|
||||
}
|
||||
function d() public pure returns (int256) {
|
||||
try this.d() returns (int256 pure res) {} catch {}
|
||||
}
|
||||
function e() public pure returns (uint) {
|
||||
try this.e() returns (uint pure res) {} catch {}
|
||||
}
|
||||
function f() public pure returns (uint256) {
|
||||
try this.f() returns (uint256 pure res) {} catch {}
|
||||
}
|
||||
function g() public pure returns (bytes1) {
|
||||
try this.g() returns (bytes1 pure res) {} catch {}
|
||||
}
|
||||
function h() public pure returns (bytes) {
|
||||
try this.h() returns (bytes pure res) {} catch {}
|
||||
}
|
||||
function i() public pure returns (bytes32) {
|
||||
try this.i() returns (bytes32 pure res) {} catch {}
|
||||
}
|
||||
function j() public pure returns (fixed) {
|
||||
try this.j() returns (fixed pure res) {} catch {}
|
||||
}
|
||||
function k() public pure returns (fixed80x80) {
|
||||
try this.k() returns (fixed80x80 pure res) {} catch {}
|
||||
}
|
||||
function l() public pure returns (ufixed) {
|
||||
try this.l() returns (ufixed pure res) {} catch {}
|
||||
}
|
||||
function m() public pure returns (ufixed80x80) {
|
||||
try this.m() returns (ufixed80x80 pure res) {} catch {}
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// ParserError 9106: (94-101): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (210-217): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (320-327): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (436-443): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (548-555): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (666-673): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (782-789): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (896-903): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1014-1021): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1128-1135): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1252-1259): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1368-1375): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1494-1501): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1622-1626): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1735-1739): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1842-1846): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (1955-1959): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (2064-2068): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (2179-2183): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (2292-2296): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (2403-2407): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (2518-2522): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (2629-2633): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (2750-2754): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (2863-2867): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (2986-2990): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (3111-3115): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (3224-3228): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (3331-3335): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (3444-3448): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (3553-3557): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (3668-3672): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (3781-3785): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (3892-3896): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (4007-4011): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (4118-4122): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (4239-4243): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (4352-4356): State mutability can only be specified for address types.
|
||||
// ParserError 9106: (4475-4479): State mutability can only be specified for address types.
|
@ -0,0 +1,7 @@
|
||||
contract C {
|
||||
function f() public {
|
||||
try this.f() {} catch (string calldata a) { }
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 6651: (70-87): Data location must be "memory" for parameter in function, but "calldata" was given.
|
@ -0,0 +1,7 @@
|
||||
contract C {
|
||||
function f() public {
|
||||
try this.f() {} catch (string storage a) { }
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 6651: (70-86): Data location must be "memory" for parameter in function, but "storage" was given.
|
@ -0,0 +1,7 @@
|
||||
contract C {
|
||||
function f() public returns (string memory) {
|
||||
try this.f() returns (string storage a) {} catch { }
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 6651: (93-109): Data location must be "memory" for parameter in function, but "storage" was given.
|
@ -0,0 +1,27 @@
|
||||
==== Source: A ====
|
||||
contract C {
|
||||
function f() public returns (uint) {
|
||||
try this.f() returns (uint indexed a) {
|
||||
} catch { }
|
||||
}
|
||||
}
|
||||
==== Source: E ====
|
||||
contract C {
|
||||
function f() public returns (uint) {
|
||||
try this.f() returns (uint) {
|
||||
} catch Error(string memory indexed x) {
|
||||
}
|
||||
}
|
||||
}
|
||||
==== Source: I ====
|
||||
contract C {
|
||||
function f() public returns (uint) {
|
||||
try this.f() returns (uint) {
|
||||
} catch (bytes memory indexed x) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// ParserError 2314: (A:89-96): Expected ',' but got 'indexed'
|
||||
// ParserError 2314: (E:128-135): Expected ',' but got 'indexed'
|
||||
// ParserError 2314: (I:122-129): Expected ',' but got 'indexed'
|
@ -0,0 +1,30 @@
|
||||
contract C {
|
||||
function f() public returns (uint, uint) {
|
||||
try this.f() returns (uint constant a, uint immutable b) {
|
||||
} catch Error(string memory immutable x) {
|
||||
x;
|
||||
}
|
||||
|
||||
try this.f() returns (uint a, uint b) {
|
||||
} catch (bytes memory immutable x) {
|
||||
x;
|
||||
}
|
||||
|
||||
try this.f() returns (uint a, uint b) {
|
||||
} catch Error(string memory constant x) {
|
||||
x;
|
||||
}
|
||||
|
||||
try this.f() returns (uint a, uint b) {
|
||||
} catch (bytes memory constant x) {
|
||||
x;
|
||||
}
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// DeclarationError 1788: (90-105): The "constant" keyword can only be used for state variables or variables at file level.
|
||||
// DeclarationError 8297: (107-123): The "immutable" keyword can only be used for state variables.
|
||||
// DeclarationError 8297: (149-174): The "immutable" keyword can only be used for state variables.
|
||||
// DeclarationError 8297: (269-293): The "immutable" keyword can only be used for state variables.
|
||||
// DeclarationError 1788: (393-417): The "constant" keyword can only be used for state variables or variables at file level.
|
||||
// DeclarationError 1788: (512-535): The "constant" keyword can only be used for state variables or variables at file level.
|
@ -0,0 +1,105 @@
|
||||
==== Source: A ====
|
||||
contract C {
|
||||
function f() public returns (uint) {
|
||||
try this.f() returns (uint public a) {
|
||||
} catch { }
|
||||
}
|
||||
}
|
||||
==== Source: B ====
|
||||
contract C {
|
||||
function f() public returns (uint) {
|
||||
try this.f() returns (uint private a) {
|
||||
} catch { }
|
||||
}
|
||||
}
|
||||
==== Source: C ====
|
||||
contract C {
|
||||
function f() public returns (uint) {
|
||||
try this.f() returns (uint external a) {
|
||||
} catch { }
|
||||
}
|
||||
}
|
||||
==== Source: D ====
|
||||
contract C {
|
||||
function f() public returns (uint) {
|
||||
try this.f() returns (uint internal a) {
|
||||
} catch { }
|
||||
}
|
||||
}
|
||||
==== Source: E ====
|
||||
contract C {
|
||||
function f() public returns (uint) {
|
||||
try this.f() returns (uint) {
|
||||
} catch Error(string memory public x) {
|
||||
}
|
||||
}
|
||||
}
|
||||
==== Source: F ====
|
||||
contract C {
|
||||
function f() public returns (uint) {
|
||||
try this.f() returns (uint) {
|
||||
} catch Error(string memory private x) {
|
||||
}
|
||||
}
|
||||
}
|
||||
==== Source: G ====
|
||||
contract C {
|
||||
function f() public returns (uint) {
|
||||
try this.f() returns (uint) {
|
||||
} catch Error(string memory external x) {
|
||||
}
|
||||
}
|
||||
}
|
||||
==== Source: H ====
|
||||
contract C {
|
||||
function f() public returns (uint) {
|
||||
try this.f() returns (uint) {
|
||||
} catch Error(string memory internal x) {
|
||||
}
|
||||
}
|
||||
}
|
||||
==== Source: I ====
|
||||
contract C {
|
||||
function f() public returns (uint) {
|
||||
try this.f() returns (uint) {
|
||||
} catch (bytes memory public x) {
|
||||
}
|
||||
}
|
||||
}
|
||||
==== Source: J ====
|
||||
contract C {
|
||||
function f() public returns (uint) {
|
||||
try this.f() returns (uint) {
|
||||
} catch (bytes memory private x) {
|
||||
}
|
||||
}
|
||||
}
|
||||
==== Source: K ====
|
||||
contract C {
|
||||
function f() public returns (uint) {
|
||||
try this.f() returns (uint) {
|
||||
} catch (bytes memory external x) {
|
||||
}
|
||||
}
|
||||
}
|
||||
==== Source: L ====
|
||||
contract C {
|
||||
function f() public returns (uint) {
|
||||
try this.f() returns (uint) {
|
||||
} catch (bytes memory internal x) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// ParserError 2314: (A:89-95): Expected ',' but got 'public'
|
||||
// ParserError 2314: (B:89-96): Expected ',' but got 'private'
|
||||
// ParserError 2314: (C:89-97): Expected ',' but got 'external'
|
||||
// ParserError 2314: (D:89-97): Expected ',' but got 'internal'
|
||||
// ParserError 2314: (E:128-134): Expected ',' but got 'public'
|
||||
// ParserError 2314: (F:128-135): Expected ',' but got 'private'
|
||||
// ParserError 2314: (G:128-136): Expected ',' but got 'external'
|
||||
// ParserError 2314: (H:128-136): Expected ',' but got 'internal'
|
||||
// ParserError 2314: (I:122-128): Expected ',' but got 'public'
|
||||
// ParserError 2314: (J:122-129): Expected ',' but got 'private'
|
||||
// ParserError 2314: (K:122-130): Expected ',' but got 'external'
|
||||
// ParserError 2314: (L:122-130): Expected ',' but got 'internal'
|
@ -0,0 +1,132 @@
|
||||
==== Source: A1 ====
|
||||
contract C {
|
||||
function f() public returns (string memory) {
|
||||
try this.f() returns (string memory memory a) { } catch { }
|
||||
}
|
||||
}
|
||||
==== Source: A2 ====
|
||||
contract C {
|
||||
function f() public returns (string memory) {
|
||||
try this.f() returns (string memory storage a) { } catch { }
|
||||
}
|
||||
}
|
||||
==== Source: A3 ====
|
||||
contract C {
|
||||
function f() public returns (string memory) {
|
||||
try this.f() returns (string memory calldata a) { } catch { }
|
||||
}
|
||||
}
|
||||
|
||||
==== Source: B1 ====
|
||||
contract C {
|
||||
function f() public returns (string memory) {
|
||||
try this.f() returns (string calldata memory a) { } catch { }
|
||||
}
|
||||
}
|
||||
==== Source: B2 ====
|
||||
contract C {
|
||||
function f() public returns (string memory) {
|
||||
try this.f() returns (string calldata storage a) { } catch { }
|
||||
}
|
||||
}
|
||||
==== Source: B3 ====
|
||||
contract C {
|
||||
function f() public returns (string memory) {
|
||||
try this.f() returns (string calldata calldata a) { } catch { }
|
||||
}
|
||||
}
|
||||
|
||||
==== Source: C1 ====
|
||||
contract C {
|
||||
function f() public returns (string memory) {
|
||||
try this.f() returns (string storage memory a) { } catch { }
|
||||
}
|
||||
}
|
||||
==== Source: C2 ====
|
||||
contract C {
|
||||
function f() public returns (string memory) {
|
||||
try this.f() returns (string storage storage a) { } catch { }
|
||||
}
|
||||
}
|
||||
==== Source: C3 ====
|
||||
contract C {
|
||||
function f() public returns (string memory) {
|
||||
try this.f() returns (string storage calldata a) { } catch { }
|
||||
}
|
||||
}
|
||||
|
||||
==== Source: D1 ====
|
||||
contract C {
|
||||
function f() public {
|
||||
try this.f() {} catch (string memory memory x) { }
|
||||
}
|
||||
}
|
||||
==== Source: D2 ====
|
||||
contract C {
|
||||
function f() public {
|
||||
try this.f() {} catch (string memory calldata x) { }
|
||||
}
|
||||
}
|
||||
==== Source: D3 ====
|
||||
contract C {
|
||||
function f() public {
|
||||
try this.f() {} catch (string memory storage x) { }
|
||||
}
|
||||
}
|
||||
|
||||
==== Source: E1 ====
|
||||
contract C {
|
||||
function f() public {
|
||||
try this.f() {} catch (string calldata memory x) { }
|
||||
}
|
||||
}
|
||||
==== Source: E2 ====
|
||||
contract C {
|
||||
function f() public {
|
||||
try this.f() {} catch (string calldata calldata x) { }
|
||||
}
|
||||
}
|
||||
==== Source: E3 ====
|
||||
contract C {
|
||||
function f() public {
|
||||
try this.f() {} catch (string calldata storage x) { }
|
||||
}
|
||||
}
|
||||
|
||||
==== Source: G1 ====
|
||||
contract C {
|
||||
function f() public {
|
||||
try this.f() {} catch (string storage memory x) { }
|
||||
}
|
||||
}
|
||||
==== Source: G2 ====
|
||||
contract C {
|
||||
function f() public {
|
||||
try this.f() {} catch (string storage calldata x) { }
|
||||
}
|
||||
}
|
||||
==== Source: G3 ====
|
||||
contract C {
|
||||
function f() public {
|
||||
try this.f() {} catch (string storage storage x) { }
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// ParserError 3548: (A1:107-113): Location already specified.
|
||||
// ParserError 3548: (A2:107-114): Location already specified.
|
||||
// ParserError 3548: (A3:107-115): Location already specified.
|
||||
// ParserError 3548: (B1:109-115): Location already specified.
|
||||
// ParserError 3548: (B2:109-116): Location already specified.
|
||||
// ParserError 3548: (B3:109-117): Location already specified.
|
||||
// ParserError 3548: (C1:108-114): Location already specified.
|
||||
// ParserError 3548: (C2:108-115): Location already specified.
|
||||
// ParserError 3548: (C3:108-116): Location already specified.
|
||||
// ParserError 3548: (D1:85-91): Location already specified.
|
||||
// ParserError 3548: (D2:85-93): Location already specified.
|
||||
// ParserError 3548: (D3:85-92): Location already specified.
|
||||
// ParserError 3548: (E1:87-93): Location already specified.
|
||||
// ParserError 3548: (E2:87-95): Location already specified.
|
||||
// ParserError 3548: (E3:87-94): Location already specified.
|
||||
// ParserError 3548: (G1:86-92): Location already specified.
|
||||
// ParserError 3548: (G2:86-94): Location already specified.
|
||||
// ParserError 3548: (G3:86-93): Location already specified.
|
@ -0,0 +1,5 @@
|
||||
using {f} for S global global;
|
||||
struct S { uint x; }
|
||||
function f(S memory _x) pure returns (uint) { return _x.x; }
|
||||
// ----
|
||||
// ParserError 2314: (23-29): Expected ';' but got identifier
|
@ -0,0 +1,13 @@
|
||||
==== Source: A ====
|
||||
uint external a;
|
||||
==== Source: B ====
|
||||
uint internal a;
|
||||
==== Source: C ====
|
||||
uint public a;
|
||||
==== Source: D ====
|
||||
uint private a;
|
||||
// ----
|
||||
// ParserError 2314: (A:5-13): Expected identifier but got 'external'
|
||||
// ParserError 2314: (B:5-13): Expected identifier but got 'internal'
|
||||
// ParserError 2314: (C:5-11): Expected identifier but got 'public'
|
||||
// ParserError 2314: (D:5-12): Expected identifier but got 'private'
|
@ -0,0 +1,41 @@
|
||||
==== Source: A ====
|
||||
contract test {
|
||||
function f(uint external a) public returns (uint) { }
|
||||
}
|
||||
==== Source: B ====
|
||||
contract test {
|
||||
function f(uint internal a) public returns (uint) { }
|
||||
}
|
||||
==== Source: C ====
|
||||
contract test {
|
||||
function f(uint public a) public returns (uint) { }
|
||||
}
|
||||
==== Source: D ====
|
||||
contract test {
|
||||
function f(uint private a) public returns (uint) { }
|
||||
}
|
||||
==== Source: E ====
|
||||
contract test {
|
||||
function f(uint a) public returns (uint external) { }
|
||||
}
|
||||
==== Source: F ====
|
||||
contract test {
|
||||
function f(uint a) public returns (uint internal) { }
|
||||
}
|
||||
==== Source: G ====
|
||||
contract test {
|
||||
function f(uint a) public returns (uint public) { }
|
||||
}
|
||||
==== Source: H ====
|
||||
contract test {
|
||||
function f(uint a) public returns (uint private) { }
|
||||
}
|
||||
// ----
|
||||
// ParserError 2314: (A:36-44): Expected ',' but got 'external'
|
||||
// ParserError 2314: (B:36-44): Expected ',' but got 'internal'
|
||||
// ParserError 2314: (C:36-42): Expected ',' but got 'public'
|
||||
// ParserError 2314: (D:36-43): Expected ',' but got 'private'
|
||||
// ParserError 2314: (E:60-68): Expected ',' but got 'external'
|
||||
// ParserError 2314: (F:60-68): Expected ',' but got 'internal'
|
||||
// ParserError 2314: (G:60-66): Expected ',' but got 'public'
|
||||
// ParserError 2314: (H:60-67): Expected ',' but got 'private'
|
@ -0,0 +1,29 @@
|
||||
==== Source: A ====
|
||||
contract test {
|
||||
function f(uint a) public {
|
||||
uint public a;
|
||||
}
|
||||
}
|
||||
==== Source: B ====
|
||||
contract test {
|
||||
function f(uint a) public {
|
||||
uint private a;
|
||||
}
|
||||
}
|
||||
==== Source: C ====
|
||||
contract test {
|
||||
function f(uint a) public {
|
||||
uint external a;
|
||||
}
|
||||
}
|
||||
==== Source: D ====
|
||||
contract test {
|
||||
function f(uint a) public {
|
||||
uint internal a;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// ParserError 2314: (A:61-67): Expected ';' but got 'public'
|
||||
// ParserError 2314: (B:61-68): Expected ';' but got 'private'
|
||||
// ParserError 2314: (C:61-69): Expected ';' but got 'external'
|
||||
// ParserError 2314: (D:61-69): Expected ';' but got 'internal'
|
@ -0,0 +1,53 @@
|
||||
contract C {
|
||||
uint private internal a;
|
||||
uint private public b;
|
||||
uint private private c;
|
||||
uint internal internal e;
|
||||
uint internal public f;
|
||||
uint internal private g;
|
||||
uint public internal h;
|
||||
uint public public i;
|
||||
uint public private j;
|
||||
function f1() private external {}
|
||||
function f2() private internal {}
|
||||
function f3() private public {}
|
||||
function f4() private private {}
|
||||
function f5() external external {}
|
||||
function f6() external internal {}
|
||||
function f7() external public {}
|
||||
function f8() external private {}
|
||||
function f9() internal external {}
|
||||
function f10() internal internal {}
|
||||
function f11() internal public {}
|
||||
function f12() internal private {}
|
||||
function f13() public external {}
|
||||
function f14() public internal {}
|
||||
function f15() public public {}
|
||||
function f16() public private {}
|
||||
}
|
||||
// ----
|
||||
// ParserError 4110: (30-38): Visibility already specified as "private".
|
||||
// ParserError 4110: (59-65): Visibility already specified as "private".
|
||||
// ParserError 4110: (86-93): Visibility already specified as "private".
|
||||
// ParserError 4110: (115-123): Visibility already specified as "internal".
|
||||
// ParserError 4110: (145-151): Visibility already specified as "internal".
|
||||
// ParserError 4110: (173-180): Visibility already specified as "internal".
|
||||
// ParserError 4110: (200-208): Visibility already specified as "public".
|
||||
// ParserError 4110: (228-234): Visibility already specified as "public".
|
||||
// ParserError 4110: (254-261): Visibility already specified as "public".
|
||||
// ParserError 9439: (291-299): Visibility already specified as "private".
|
||||
// ParserError 9439: (329-337): Visibility already specified as "private".
|
||||
// ParserError 9439: (367-373): Visibility already specified as "private".
|
||||
// ParserError 9439: (403-410): Visibility already specified as "private".
|
||||
// ParserError 9439: (441-449): Visibility already specified as "external".
|
||||
// ParserError 9439: (480-488): Visibility already specified as "external".
|
||||
// ParserError 9439: (519-525): Visibility already specified as "external".
|
||||
// ParserError 9439: (556-563): Visibility already specified as "external".
|
||||
// ParserError 9439: (594-602): Visibility already specified as "internal".
|
||||
// ParserError 9439: (634-642): Visibility already specified as "internal".
|
||||
// ParserError 9439: (674-680): Visibility already specified as "internal".
|
||||
// ParserError 9439: (712-719): Visibility already specified as "internal".
|
||||
// ParserError 9439: (749-757): Visibility already specified as "public".
|
||||
// ParserError 9439: (787-795): Visibility already specified as "public".
|
||||
// ParserError 9439: (825-831): Visibility already specified as "public".
|
||||
// ParserError 9439: (861-868): Visibility already specified as "public".
|
@ -0,0 +1,16 @@
|
||||
==== Source: A ====
|
||||
contract C {
|
||||
uint external external x;
|
||||
}
|
||||
==== Source: B ====
|
||||
contract C {
|
||||
uint internal external x;
|
||||
}
|
||||
==== Source: C ====
|
||||
contract C {
|
||||
uint external internal x;
|
||||
}
|
||||
// ----
|
||||
// ParserError 2314: (A:22-30): Expected identifier but got 'external'
|
||||
// ParserError 2314: (B:31-39): Expected identifier but got 'external'
|
||||
// ParserError 2314: (C:22-30): Expected identifier but got 'external'
|
Loading…
Reference in New Issue
Block a user