Update tests.

This commit is contained in:
Alexander Arlt 2019-10-23 15:10:12 -05:00
parent 793b906e05
commit cd3ad73b5a
109 changed files with 349 additions and 213 deletions

View File

@ -529,7 +529,7 @@ As an example, the code
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
contract Test { abstract contract Test {
struct S { uint a; uint[] b; T[] c; } struct S { uint a; uint[] b; T[] c; }
struct T { uint x; uint y; } struct T { uint x; uint y; }
function f(S memory s, T memory t, uint a) public; function f(S memory s, T memory t, uint a) public;

View File

@ -14,7 +14,7 @@ provided (no implementation body ``{ }`` was given).::
pragma solidity >=0.4.0 <0.7.0; pragma solidity >=0.4.0 <0.7.0;
contract Feline { abstract contract Feline {
function utterance() public returns (bytes32); function utterance() public returns (bytes32);
} }
@ -23,7 +23,7 @@ all defined functions. The usage of an abstract contract as a base class is show
pragma solidity >=0.4.0 <0.7.0; pragma solidity >=0.4.0 <0.7.0;
contract Feline { abstract contract Feline {
function utterance() public returns (bytes32); function utterance() public returns (bytes32);
} }

View File

@ -52,12 +52,12 @@ Details are given in the following example.
// interface known to the compiler. Note the function // interface known to the compiler. Note the function
// without body. If a contract does not implement all // without body. If a contract does not implement all
// functions it can only be used as an interface. // functions it can only be used as an interface.
contract Config { abstract contract Config {
function lookup(uint id) public returns (address adr); function lookup(uint id) public returns (address adr);
} }
contract NameReg { abstract contract NameReg {
function register(bytes32 name) public; function register(bytes32 name) public;
function unregister() public; function unregister() public;
} }

View File

@ -91,7 +91,7 @@ Yes::
pragma solidity >=0.4.0 <0.7.0; pragma solidity >=0.4.0 <0.7.0;
contract A { abstract contract A {
function spam() public pure; function spam() public pure;
function ham() public pure; function ham() public pure;
} }

View File

@ -34,6 +34,7 @@ JSON AST:
{ {
"attributes": "attributes":
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
null null

View File

@ -4,4 +4,4 @@ pragma solidity >=0.0; contract Errort6 { using foo for ; /* missing type name
","message":"Expected type name","severity":"error","sourceLocation":{"end":58,"file":"A","start":57},"type":"ParserError"},{"component":"general","formattedMessage":"A:1:84: Warning: Recovered in ContractDefinition at '}'. ","message":"Expected type name","severity":"error","sourceLocation":{"end":58,"file":"A","start":57},"type":"ParserError"},{"component":"general","formattedMessage":"A:1:84: Warning: Recovered in ContractDefinition at '}'.
pragma solidity >=0.0; contract Errort6 { using foo for ; /* missing type name */ } pragma solidity >=0.0; contract Errort6 { using foo for ; /* missing type name */ }
^ ^
","message":"Recovered in ContractDefinition at '}'.","severity":"warning","sourceLocation":{"end":84,"file":"A","start":83},"type":"Warning"}],"sources":{"A":{"ast":{"absolutePath":"A","exportedSymbols":{"Errort6":[3]},"id":4,"nodeType":"SourceUnit","nodes":[{"id":1,"literals":["solidity",">=","0.0"],"nodeType":"PragmaDirective","src":"0:22:0"},{"baseContracts":[],"contractDependencies":[],"contractKind":"contract","documentation":null,"fullyImplemented":true,"id":3,"linearizedBaseContracts":[3],"name":"Errort6","nodeType":"ContractDefinition","nodes":[],"scope":4,"src":"23:35:0"}],"src":"0:84:0"},"id":0}}} ","message":"Recovered in ContractDefinition at '}'.","severity":"warning","sourceLocation":{"end":84,"file":"A","start":83},"type":"Warning"}],"sources":{"A":{"ast":{"absolutePath":"A","exportedSymbols":{"Errort6":[3]},"id":4,"nodeType":"SourceUnit","nodes":[{"id":1,"literals":["solidity",">=","0.0"],"nodeType":"PragmaDirective","src":"0:22:0"},{"abstract":false,"baseContracts":[],"contractDependencies":[],"contractKind":"contract","documentation":null,"fullyImplemented":true,"id":3,"linearizedBaseContracts":[3],"name":"Errort6","nodeType":"ContractDefinition","nodes":[],"scope":4,"src":"23:35:0"}],"src":"0:84:0"},"id":0}}}

View File

@ -1 +1 @@
{"sources":{"A":{"ast":{"absolutePath":"A","exportedSymbols":{"C":[6]},"id":7,"nodeType":"SourceUnit","nodes":[{"id":1,"literals":["solidity",">=","0.0"],"nodeType":"PragmaDirective","src":"0:22:0"},{"baseContracts":[],"contractDependencies":[],"contractKind":"contract","documentation":null,"fullyImplemented":true,"id":6,"linearizedBaseContracts":[6],"name":"C","nodeType":"ContractDefinition","nodes":[{"body":{"id":4,"nodeType":"Block","src":"61:2:0","statements":[]},"documentation":null,"id":5,"implemented":true,"kind":"function","modifiers":[],"name":"f","nodeType":"FunctionDefinition","overrides":null,"parameters":{"id":2,"nodeType":"ParameterList","parameters":[],"src":"46:2:0"},"returnParameters":{"id":3,"nodeType":"ParameterList","parameters":[],"src":"61:0:0"},"scope":6,"src":"36:27:0","stateMutability":"pure","superFunction":null,"visibility":"public"}],"scope":7,"src":"23:42:0"}],"src":"0:65:0"},"id":0}}} {"sources":{"A":{"ast":{"absolutePath":"A","exportedSymbols":{"C":[6]},"id":7,"nodeType":"SourceUnit","nodes":[{"id":1,"literals":["solidity",">=","0.0"],"nodeType":"PragmaDirective","src":"0:22:0"},{"abstract":false,"baseContracts":[],"contractDependencies":[],"contractKind":"contract","documentation":null,"fullyImplemented":true,"id":6,"linearizedBaseContracts":[6],"name":"C","nodeType":"ContractDefinition","nodes":[{"body":{"id":4,"nodeType":"Block","src":"61:2:0","statements":[]},"documentation":null,"id":5,"implemented":true,"kind":"function","modifiers":[],"name":"f","nodeType":"FunctionDefinition","overrides":null,"parameters":{"id":2,"nodeType":"ParameterList","parameters":[],"src":"46:2:0"},"returnParameters":{"id":3,"nodeType":"ParameterList","parameters":[],"src":"61:0:0"},"scope":6,"src":"36:27:0","stateMutability":"pure","superFunction":null,"visibility":"public"}],"scope":7,"src":"23:42:0"}],"src":"0:65:0"},"id":0}}}

View File

@ -6,7 +6,7 @@ import "../Oracles/Oracle.sol";
/// @title Event contract - Provide basic functionality required by different event types /// @title Event contract - Provide basic functionality required by different event types
/// @author Stefan George - <stefan@gnosis.pm> /// @author Stefan George - <stefan@gnosis.pm>
contract Event { abstract contract Event {
/* /*
* Events * Events

View File

@ -3,7 +3,7 @@ import "../Markets/Market.sol";
/// @title Abstract market maker contract - Functions to be implemented by market maker contracts /// @title Abstract market maker contract - Functions to be implemented by market maker contracts
contract MarketMaker { abstract contract MarketMaker {
/* /*
* Public functions * Public functions

View File

@ -4,7 +4,7 @@ import "../MarketMakers/MarketMaker.sol";
/// @title Abstract market contract - Functions to be implemented by market contracts /// @title Abstract market contract - Functions to be implemented by market contracts
contract Market { abstract contract Market {
/* /*
* Events * Events

View File

@ -5,7 +5,7 @@ import "../Markets/Market.sol";
/// @title Abstract market factory contract - Functions to be implemented by market factories /// @title Abstract market factory contract - Functions to be implemented by market factories
contract MarketFactory { abstract contract MarketFactory {
/* /*
* Events * Events

View File

@ -2,7 +2,7 @@ pragma solidity >=0.0;
/// @title Abstract oracle contract - Functions to be implemented by oracles /// @title Abstract oracle contract - Functions to be implemented by oracles
contract Oracle { abstract contract Oracle {
function isOutcomeSet() public view returns (bool); function isOutcomeSet() public view returns (bool);
function getOutcome() public view returns (int); function getOutcome() public view returns (int);

View File

@ -3,7 +3,7 @@ pragma solidity >=0.0;
/// @title Abstract token contract - Functions to be implemented by token contracts /// @title Abstract token contract - Functions to be implemented by token contracts
contract Token { abstract contract Token {
/* /*
* Events * Events

View File

@ -24,7 +24,7 @@ to automate organizational governance and decision-making.
import "./TokenCreation.sol"; import "./TokenCreation.sol";
import "./ManagedAccount.sol"; import "./ManagedAccount.sol";
contract DAOInterface { abstract contract DAOInterface {
// The amount of days for which people who try to participate in the // The amount of days for which people who try to participate in the
// creation by calling the fallback function will still get their ether back // creation by calling the fallback function will still get their ether back

View File

@ -21,7 +21,7 @@ Basic account, used by the DAO contract to separately manage both the rewards
and the extraBalance accounts. and the extraBalance accounts.
*/ */
contract ManagedAccountInterface { abstract contract ManagedAccountInterface {
// The only address with permission to withdraw from this account // The only address with permission to withdraw from this account
address public owner; address public owner;
// If true, only the owner of the account can receive ether from it // If true, only the owner of the account can receive ether from it

View File

@ -30,7 +30,7 @@ https://github.com/ethereum/wiki/wiki/Standardized_Contract_APIs
/// @title Standard Token Contract. /// @title Standard Token Contract.
contract TokenInterface { abstract contract TokenInterface {
mapping (address => uint256) balances; mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed; mapping (address => mapping (address => uint256)) allowed;
@ -85,7 +85,7 @@ contract TokenInterface {
); );
} }
contract tokenRecipient { abstract contract tokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes memory _extraData) public; function receiveApproval(address _from, uint256 _value, address _token, bytes memory _extraData) public;
} }

View File

@ -25,7 +25,7 @@ along with the DAO. If not, see <http://www.gnu.org/licenses/>.
import "./Token.sol"; import "./Token.sol";
import "./ManagedAccount.sol"; import "./ManagedAccount.sol";
contract TokenCreationInterface { abstract contract TokenCreationInterface {
// End of token creation, in Unix time // End of token creation, in Unix time
uint public closingTime; uint public closingTime;

View File

@ -1,72 +1,72 @@
{ {
"absolutePath" : "a", "absolutePath": "a",
"exportedSymbols" : "exportedSymbols":
{ {
"C" : "C":
[ [
5 5
] ]
}, },
"id" : 6, "id": 6,
"nodeType" : "SourceUnit", "nodeType": "SourceUnit",
"nodes" : "nodes":
[ [
{ {
"abstract" : true, "abstract": true,
"baseContracts" : [], "baseContracts": [],
"contractDependencies" : [], "contractDependencies": [],
"contractKind" : "contract", "contractKind": "contract",
"documentation" : null, "documentation": null,
"fullyImplemented" : true, "fullyImplemented": true,
"id" : 5, "id": 5,
"linearizedBaseContracts" : "linearizedBaseContracts":
[ [
5 5
], ],
"name" : "C", "name": "C",
"nodeType" : "ContractDefinition", "nodeType": "ContractDefinition",
"nodes" : "nodes":
[ [
{ {
"body" : "body":
{ {
"id" : 3, "id": 3,
"nodeType" : "Block", "nodeType": "Block",
"src" : "44:4:1", "src": "44:4:1",
"statements" : [] "statements": []
}, },
"documentation" : null, "documentation": null,
"id" : 4, "id": 4,
"implemented" : true, "implemented": true,
"kind" : "constructor", "kind": "constructor",
"modifiers" : [], "modifiers": [],
"name" : "", "name": "",
"nodeType" : "FunctionDefinition", "nodeType": "FunctionDefinition",
"overrides" : null, "overrides": null,
"parameters" : "parameters":
{ {
"id" : 1, "id": 1,
"nodeType" : "ParameterList", "nodeType": "ParameterList",
"parameters" : [], "parameters": [],
"src" : "34:2:1" "src": "34:2:1"
}, },
"returnParameters" : "returnParameters":
{ {
"id" : 2, "id": 2,
"nodeType" : "ParameterList", "nodeType": "ParameterList",
"parameters" : [], "parameters": [],
"src" : "44:0:1" "src": "44:0:1"
}, },
"scope" : 5, "scope": 5,
"src" : "23:25:1", "src": "23:25:1",
"stateMutability" : "nonpayable", "stateMutability": "nonpayable",
"superFunction" : null, "superFunction": null,
"visibility" : "public" "visibility": "public"
} }
], ],
"scope" : 6, "scope": 6,
"src" : "0:50:1" "src": "0:50:1"
} }
], ],
"src" : "0:51:1" "src": "0:51:1"
} }

View File

@ -1,112 +1,112 @@
{ {
"attributes" : "attributes":
{ {
"absolutePath" : "a", "absolutePath": "a",
"exportedSymbols" : "exportedSymbols":
{ {
"C" : "C":
[ [
5 5
] ]
} }
}, },
"children" : "children":
[ [
{ {
"attributes" : "attributes":
{ {
"abstract" : true, "abstract": true,
"baseContracts" : "baseContracts":
[ [
null null
], ],
"contractDependencies" : "contractDependencies":
[ [
null null
], ],
"contractKind" : "contract", "contractKind": "contract",
"documentation" : null, "documentation": null,
"fullyImplemented" : true, "fullyImplemented": true,
"linearizedBaseContracts" : "linearizedBaseContracts":
[ [
5 5
], ],
"name" : "C", "name": "C",
"scope" : 6 "scope": 6
}, },
"children" : "children":
[ [
{ {
"attributes" : "attributes":
{ {
"documentation" : null, "documentation": null,
"implemented" : true, "implemented": true,
"isConstructor" : true, "isConstructor": true,
"kind" : "constructor", "kind": "constructor",
"modifiers" : "modifiers":
[ [
null null
], ],
"name" : "", "name": "",
"overrides" : null, "overrides": null,
"scope" : 5, "scope": 5,
"stateMutability" : "nonpayable", "stateMutability": "nonpayable",
"superFunction" : null, "superFunction": null,
"visibility" : "public" "visibility": "public"
}, },
"children" : "children":
[ [
{ {
"attributes" : "attributes":
{ {
"parameters" : "parameters":
[ [
null null
] ]
}, },
"children" : [], "children": [],
"id" : 1, "id": 1,
"name" : "ParameterList", "name": "ParameterList",
"src" : "34:2:1" "src": "34:2:1"
}, },
{ {
"attributes" : "attributes":
{ {
"parameters" : "parameters":
[ [
null null
] ]
}, },
"children" : [], "children": [],
"id" : 2, "id": 2,
"name" : "ParameterList", "name": "ParameterList",
"src" : "44:0:1" "src": "44:0:1"
}, },
{ {
"attributes" : "attributes":
{ {
"statements" : "statements":
[ [
null null
] ]
}, },
"children" : [], "children": [],
"id" : 3, "id": 3,
"name" : "Block", "name": "Block",
"src" : "44:4:1" "src": "44:4:1"
} }
], ],
"id" : 4, "id": 4,
"name" : "FunctionDefinition", "name": "FunctionDefinition",
"src" : "23:25:1" "src": "23:25:1"
} }
], ],
"id" : 5, "id": 5,
"name" : "ContractDefinition", "name": "ContractDefinition",
"src" : "0:50:1" "src": "0:50:1"
} }
], ],
"id" : 6, "id": 6,
"name" : "SourceUnit", "name": "SourceUnit",
"src" : "0:51:1" "src": "0:51:1"
} }

View File

@ -12,6 +12,7 @@
"nodes": "nodes":
[ [
{ {
"abstract": false,
"baseContracts": [], "baseContracts": [],
"contractDependencies": [], "contractDependencies": [],
"contractKind": "contract", "contractKind": "contract",

View File

@ -15,6 +15,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
null null

View File

@ -12,6 +12,7 @@
"nodes": "nodes":
[ [
{ {
"abstract": false,
"baseContracts": [], "baseContracts": [],
"contractDependencies": [], "contractDependencies": [],
"contractKind": "contract", "contractKind": "contract",

View File

@ -15,6 +15,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
null null

View File

@ -12,6 +12,7 @@
"nodes": "nodes":
[ [
{ {
"abstract": false,
"baseContracts": [], "baseContracts": [],
"contractDependencies": [], "contractDependencies": [],
"contractKind": "contract", "contractKind": "contract",

View File

@ -15,6 +15,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
null null

View File

@ -28,6 +28,7 @@
"nodes": "nodes":
[ [
{ {
"abstract": false,
"baseContracts": [], "baseContracts": [],
"contractDependencies": [], "contractDependencies": [],
"contractKind": "contract", "contractKind": "contract",
@ -45,6 +46,7 @@
"src": "0:14:1" "src": "0:14:1"
}, },
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
{ {
@ -88,6 +90,7 @@
"src": "15:19:1" "src": "15:19:1"
}, },
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
{ {
@ -133,6 +136,7 @@
"src": "35:19:1" "src": "35:19:1"
}, },
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
{ {
@ -180,6 +184,7 @@
"src": "55:19:1" "src": "55:19:1"
}, },
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
{ {

View File

@ -31,6 +31,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
null null
@ -60,6 +61,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"contractDependencies": "contractDependencies":
[ [
1 1
@ -113,6 +115,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"contractDependencies": "contractDependencies":
[ [
1, 1,
@ -168,6 +171,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"contractDependencies": "contractDependencies":
[ [
1, 1,
@ -225,6 +229,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"contractDependencies": "contractDependencies":
[ [
1, 1,

View File

@ -12,6 +12,7 @@
"nodes": "nodes":
[ [
{ {
"abstract": false,
"baseContracts": [], "baseContracts": [],
"contractDependencies": [], "contractDependencies": [],
"contractKind": "contract", "contractKind": "contract",
@ -45,6 +46,7 @@
"nodes": "nodes":
[ [
{ {
"abstract": false,
"baseContracts": [], "baseContracts": [],
"contractDependencies": [], "contractDependencies": [],
"contractKind": "contract", "contractKind": "contract",
@ -78,6 +80,7 @@
"nodes": "nodes":
[ [
{ {
"abstract": false,
"baseContracts": [], "baseContracts": [],
"contractDependencies": [], "contractDependencies": [],
"contractKind": "contract", "contractKind": "contract",

View File

@ -15,6 +15,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
null null

View File

@ -12,6 +12,7 @@
"nodes": "nodes":
[ [
{ {
"abstract": false,
"baseContracts": [], "baseContracts": [],
"contractDependencies": [], "contractDependencies": [],
"contractKind": "contract", "contractKind": "contract",

View File

@ -15,6 +15,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
null null

View File

@ -12,6 +12,7 @@
"nodes": "nodes":
[ [
{ {
"abstract": false,
"baseContracts": [], "baseContracts": [],
"contractDependencies": [], "contractDependencies": [],
"contractKind": "contract", "contractKind": "contract",

View File

@ -15,6 +15,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
null null

View File

@ -12,6 +12,7 @@
"nodes": "nodes":
[ [
{ {
"abstract": false,
"baseContracts": [], "baseContracts": [],
"contractDependencies": [], "contractDependencies": [],
"contractKind": "contract", "contractKind": "contract",

View File

@ -15,6 +15,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
null null

View File

@ -12,6 +12,7 @@
"nodes": "nodes":
[ [
{ {
"abstract": false,
"baseContracts": [], "baseContracts": [],
"contractDependencies": [], "contractDependencies": [],
"contractKind": "contract", "contractKind": "contract",

View File

@ -15,6 +15,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
null null

View File

@ -12,6 +12,7 @@
"nodes": "nodes":
[ [
{ {
"abstract": false,
"baseContracts": [], "baseContracts": [],
"contractDependencies": [], "contractDependencies": [],
"contractKind": "contract", "contractKind": "contract",

View File

@ -15,6 +15,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
null null

View File

@ -16,6 +16,7 @@
"nodes": "nodes":
[ [
{ {
"abstract": false,
"baseContracts": [], "baseContracts": [],
"contractDependencies": [], "contractDependencies": [],
"contractKind": "contract", "contractKind": "contract",
@ -33,6 +34,7 @@
"src": "0:14:1" "src": "0:14:1"
}, },
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
{ {

View File

@ -19,6 +19,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
null null
@ -48,6 +49,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"contractDependencies": "contractDependencies":
[ [
1 1

View File

@ -12,6 +12,7 @@
"nodes": "nodes":
[ [
{ {
"abstract": false,
"baseContracts": [], "baseContracts": [],
"contractDependencies": [], "contractDependencies": [],
"contractKind": "contract", "contractKind": "contract",

View File

@ -15,6 +15,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
null null

View File

@ -12,6 +12,7 @@
"nodes": "nodes":
[ [
{ {
"abstract": false,
"baseContracts": [], "baseContracts": [],
"contractDependencies": [], "contractDependencies": [],
"contractKind": "contract", "contractKind": "contract",

View File

@ -15,6 +15,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
null null

View File

@ -12,6 +12,7 @@
"nodes": "nodes":
[ [
{ {
"abstract": false,
"baseContracts": [], "baseContracts": [],
"contractDependencies": [], "contractDependencies": [],
"contractKind": "contract", "contractKind": "contract",

View File

@ -15,6 +15,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
null null

View File

@ -12,6 +12,7 @@
"nodes": "nodes":
[ [
{ {
"abstract": false,
"baseContracts": [], "baseContracts": [],
"contractDependencies": [], "contractDependencies": [],
"contractKind": "contract", "contractKind": "contract",

View File

@ -15,6 +15,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
null null

View File

@ -12,6 +12,7 @@
"nodes": "nodes":
[ [
{ {
"abstract": false,
"baseContracts": [], "baseContracts": [],
"contractDependencies": [], "contractDependencies": [],
"contractKind": "contract", "contractKind": "contract",

View File

@ -15,6 +15,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
null null

View File

@ -20,6 +20,7 @@
"nodes": "nodes":
[ [
{ {
"abstract": false,
"baseContracts": [], "baseContracts": [],
"contractDependencies": [], "contractDependencies": [],
"contractKind": "contract", "contractKind": "contract",
@ -75,6 +76,7 @@
"src": "0:40:1" "src": "0:40:1"
}, },
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
{ {
@ -186,6 +188,7 @@
"src": "41:78:1" "src": "41:78:1"
}, },
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
{ {

View File

@ -23,6 +23,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
null null
@ -115,6 +116,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"contractDependencies": "contractDependencies":
[ [
5 5
@ -283,6 +285,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"contractDependencies": "contractDependencies":
[ [
5, 5,

View File

@ -12,6 +12,7 @@
"nodes": "nodes":
[ [
{ {
"abstract": false,
"baseContracts": [], "baseContracts": [],
"contractDependencies": [], "contractDependencies": [],
"contractKind": "contract", "contractKind": "contract",

View File

@ -15,6 +15,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
null null

View File

@ -12,6 +12,7 @@
"nodes": "nodes":
[ [
{ {
"abstract": false,
"baseContracts": [], "baseContracts": [],
"contractDependencies": [], "contractDependencies": [],
"contractKind": "contract", "contractKind": "contract",

View File

@ -15,6 +15,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
null null

View File

@ -12,6 +12,7 @@
"nodes": "nodes":
[ [
{ {
"abstract": false,
"baseContracts": [], "baseContracts": [],
"contractDependencies": [], "contractDependencies": [],
"contractKind": "contract", "contractKind": "contract",

View File

@ -15,6 +15,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
null null

View File

@ -12,6 +12,7 @@
"nodes": "nodes":
[ [
{ {
"abstract": false,
"baseContracts": [], "baseContracts": [],
"contractDependencies": [], "contractDependencies": [],
"contractKind": "contract", "contractKind": "contract",

View File

@ -15,6 +15,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
null null

View File

@ -12,6 +12,7 @@
"nodes": "nodes":
[ [
{ {
"abstract": false,
"baseContracts": [], "baseContracts": [],
"contractDependencies": [], "contractDependencies": [],
"contractKind": "contract", "contractKind": "contract",

View File

@ -15,6 +15,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
null null

View File

@ -16,6 +16,7 @@
"nodes": "nodes":
[ [
{ {
"abstract": false,
"baseContracts": [], "baseContracts": [],
"contractDependencies": [], "contractDependencies": [],
"contractKind": "library", "contractKind": "library",
@ -33,6 +34,7 @@
"src": "0:12:1" "src": "0:12:1"
}, },
{ {
"abstract": false,
"baseContracts": [], "baseContracts": [],
"contractDependencies": [], "contractDependencies": [],
"contractKind": "contract", "contractKind": "contract",

View File

@ -19,6 +19,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
null null
@ -48,6 +49,7 @@
{ {
"attributes": "attributes":
{ {
"abstract": false,
"baseContracts": "baseContracts":
[ [
null null

View File

@ -65,7 +65,7 @@ BOOST_AUTO_TEST_CASE(abstract_contract)
SourceUnit const* sourceUnit = nullptr; SourceUnit const* sourceUnit = nullptr;
char const* text = R"( char const* text = R"(
abstract contract base { function foo() public; } abstract contract base { function foo() public; }
contract derived is base { function foo() public {} } contract derived is base { function foo() public override {} }
)"; )";
sourceUnit = parseAndAnalyse(text); sourceUnit = parseAndAnalyse(text);
std::vector<ASTPointer<ASTNode>> nodes = sourceUnit->nodes(); std::vector<ASTPointer<ASTNode>> nodes = sourceUnit->nodes();

View File

@ -17,4 +17,4 @@ contract C
} }
} }
// ---- // ----
// Warning: (240-254): Assertion violation happens here // TypeError: (33-75): Contract "D" should be marked as abstract.

View File

@ -17,4 +17,4 @@ contract C
} }
} }
// ---- // ----
// Warning: (280-304): Assertion violation happens here // TypeError: (33-75): Contract "D" should be marked as abstract.

View File

@ -18,4 +18,4 @@ contract C
} }
} }
// ---- // ----
// Warning: (338-362): Assertion violation happens here // TypeError: (33-75): Contract "D" should be marked as abstract.

View File

@ -1,3 +0,0 @@
abstract abstract contract A { constructor() public {} }
// ----
// ParserError: (9-17): Contract expected.

View File

@ -0,0 +1,7 @@
interface A {
function utterance() external returns (bytes32);
}
contract B is A {
}
// ----
// TypeError: (69-88): Contract "B" should be marked as abstract.

View File

@ -1,3 +1,3 @@
abstract interface A { } abstract interface A { }
// ---- // ----
// ParserError: (0-8): Only contracts can be abstract. // TypeError: (0-24): Only contracts can be abstract.

View File

@ -1,3 +1,3 @@
abstract library A { } abstract library A { }
// ---- // ----
// ParserError: (0-8): Only contracts can be abstract. // TypeError: (0-22): Only contracts can be abstract.

View File

@ -12,4 +12,4 @@ contract Parent {
contract Child is Parent { contract Child is Parent {
} }
// ---- // ----
// TypeError: (146-155): Trying to create an instance of an abstract contract. // TypeError: (146-155): Cannot instantiate an abstract contract.

View File

@ -2,3 +2,5 @@ contract C {
function f() internal returns(uint[] storage); function f() internal returns(uint[] storage);
function g() internal returns(uint[] storage s); function g() internal returns(uint[] storage s);
} }
// ----
// TypeError: (0-118): Contract "C" should be marked as abstract.

View File

@ -2,3 +2,4 @@ contract test {
function f(bytes calldata) external; function f(bytes calldata) external;
} }
// ---- // ----
// TypeError: (0-58): Contract "test" should be marked as abstract.

View File

@ -2,3 +2,4 @@ contract test {
function f(bytes memory) internal; function f(bytes memory) internal;
} }
// ---- // ----
// TypeError: (0-56): Contract "test" should be marked as abstract.

View File

@ -2,3 +2,4 @@ contract test {
function f(bytes storage) internal; function f(bytes storage) internal;
} }
// ---- // ----
// TypeError: (0-57): Contract "test" should be marked as abstract.

View File

@ -2,3 +2,4 @@ contract test {
function f(bytes memory) public; function f(bytes memory) public;
} }
// ---- // ----
// TypeError: (0-54): Contract "test" should be marked as abstract.

View File

@ -7,3 +7,4 @@ contract T {
} }
// ---- // ----
// DeclarationError: (81-105): Identifier already declared. // DeclarationError: (81-105): Identifier already declared.
// TypeError: (0-58): Contract "X" should be marked as abstract.

View File

@ -5,3 +5,5 @@ contract Y is X {
contract T { contract T {
constructor() public { new Y(); } constructor() public { new Y(); }
} }
// ----
// TypeError: (0-57): Contract "X" should be marked as abstract.

View File

@ -7,3 +7,4 @@ contract T {
} }
// ---- // ----
// DeclarationError: (79-103): Identifier already declared. // DeclarationError: (79-103): Identifier already declared.
// TypeError: (0-56): Contract "X" should be marked as abstract.

View File

@ -9,3 +9,5 @@ contract X is A {
function test2() internal override(A) returns (uint256); function test2() internal override(A) returns (uint256);
} }
// ---- // ----
// TypeError: (0-126): Contract "A" should be marked as abstract.
// TypeError: (127-288): Contract "X" should be marked as abstract.

View File

@ -11,4 +11,7 @@ contract X is A, B {
function test() internal override returns (uint256); function test() internal override returns (uint256);
} }
// ---- // ----
// TypeError: (0-79): Contract "A" should be marked as abstract.
// TypeError: (80-183): Contract "B" should be marked as abstract.
// TypeError: (184-290): Derived contract must override function "foo". Function with the same name and parameter types defined in two or more base classes. // TypeError: (184-290): Derived contract must override function "foo". Function with the same name and parameter types defined in two or more base classes.
// TypeError: (184-290): Contract "X" should be marked as abstract.

View File

@ -18,3 +18,8 @@ contract X is D {
function foo() internal override returns (uint256); function foo() internal override returns (uint256);
} }
// ---- // ----
// TypeError: (0-58): Contract "A" should be marked as abstract.
// TypeError: (60-132): Contract "B" should be marked as abstract.
// TypeError: (134-206): Contract "C" should be marked as abstract.
// TypeError: (208-280): Contract "D" should be marked as abstract.
// TypeError: (282-354): Contract "X" should be marked as abstract.

View File

@ -19,3 +19,8 @@ contract X is A, B, C, D {
function foo() internal override(A, B, C, D) returns (uint256); function foo() internal override(A, B, C, D) returns (uint256);
} }
// ---- // ----
// TypeError: (0-132): Contract "A" should be marked as abstract.
// TypeError: (133-236): Contract "B" should be marked as abstract.
// TypeError: (237-295): Contract "C" should be marked as abstract.
// TypeError: (296-354): Contract "D" should be marked as abstract.
// TypeError: (355-532): Contract "X" should be marked as abstract.

View File

@ -13,3 +13,7 @@ contract D is A, B, C {
function foo() internal override(A, B) returns (uint256); function foo() internal override(A, B) returns (uint256);
} }
// ---- // ----
// TypeError: (0-132): Contract "A" should be marked as abstract.
// TypeError: (133-191): Contract "B" should be marked as abstract.
// TypeError: (193-212): Contract "C" should be marked as abstract.
// TypeError: (213-297): Contract "D" should be marked as abstract.

View File

@ -20,7 +20,12 @@ contract X is A, B, C, D {
function foo() internal override(A, C, B, B, B, D ,D) returns (uint256); function foo() internal override(A, C, B, B, B, D ,D) returns (uint256);
} }
// ---- // ----
// TypeError: (0-132): Contract "A" should be marked as abstract.
// TypeError: (133-236): Contract "B" should be marked as abstract.
// TypeError: (237-295): Contract "C" should be marked as abstract.
// TypeError: (296-399): Contract "D" should be marked as abstract.
// TypeError: (498-499): Duplicate contract "D" found in override list of "test". // TypeError: (498-499): Duplicate contract "D" found in override list of "test".
// TypeError: (563-564): Duplicate contract "B" found in override list of "foo". // TypeError: (560-561): Duplicate contract "B" found in override list of "foo".
// TypeError: (566-567): Duplicate contract "B" found in override list of "foo". // TypeError: (566-567): Duplicate contract "B" found in override list of "foo".
// TypeError: (572-573): Duplicate contract "D" found in override list of "foo". // TypeError: (572-573): Duplicate contract "D" found in override list of "foo".
// TypeError: (400-595): Contract "X" should be marked as abstract.

View File

@ -20,5 +20,10 @@ contract X is A, B, C, D {
function foo() internal override(A, C) returns (uint256); function foo() internal override(A, C) returns (uint256);
} }
// ---- // ----
// TypeError: (0-132): Contract "A" should be marked as abstract.
// TypeError: (133-236): Contract "B" should be marked as abstract.
// TypeError: (237-295): Contract "C" should be marked as abstract.
// TypeError: (296-399): Contract "D" should be marked as abstract.
// TypeError: (483-500): Invalid contract specified in override list: C. // TypeError: (483-500): Invalid contract specified in override list: C.
// TypeError: (545-559): Function needs to specify overridden contracts B and D. // TypeError: (545-559): Function needs to specify overridden contracts B and D.
// TypeError: (400-580): Contract "X" should be marked as abstract.

View File

@ -11,4 +11,7 @@ contract X is A, B {
function test() internal override returns (uint256); function test() internal override returns (uint256);
} }
// ---- // ----
// TypeError: (0-79): Contract "A" should be marked as abstract.
// TypeError: (80-181): Contract "B" should be marked as abstract.
// TypeError: (182-288): Derived contract must override function "foo". Function with the same name and parameter types defined in two or more base classes. // TypeError: (182-288): Derived contract must override function "foo". Function with the same name and parameter types defined in two or more base classes.
// TypeError: (182-288): Contract "X" should be marked as abstract.

View File

@ -22,5 +22,8 @@ contract X is A, B, C, D {
function foo() internal override(MyStruct, ENUM, A, B, C, D) returns (uint256); function foo() internal override(MyStruct, ENUM, A, B, C, D) returns (uint256);
} }
// ---- // ----
// TypeError: (552-560): Expected contract but got struct X.MyStruct. // TypeError: (0-132): Contract "A" should be marked as abstract.
// TypeError: (562-566): Expected contract but got enum X.ENUM. // TypeError: (133-236): Contract "B" should be marked as abstract.
// TypeError: (237-295): Contract "C" should be marked as abstract.
// TypeError: (296-354): Contract "D" should be marked as abstract.
// TypeError: (355-600): Contract "X" should be marked as abstract.

View File

@ -7,4 +7,5 @@ contract Other {
function f(uint) public returns (uint); function f(uint) public returns (uint);
} }
// ---- // ----
// TypeError: (131-193): Contract "Other" should be marked as abstract.
// TypeError: (97-121): Member "creationCode" not found or not visible after argument-dependent lookup in type(contract Other). // TypeError: (97-121): Member "creationCode" not found or not visible after argument-dependent lookup in type(contract Other).

View File

@ -7,4 +7,5 @@ contract Other {
function f(uint) public returns (uint); function f(uint) public returns (uint);
} }
// ---- // ----
// TypeError: (124-186): Contract "Other" should be marked as abstract.
// TypeError: (91-114): Member "runtimeCode" not found or not visible after argument-dependent lookup in type(contract Other). // TypeError: (91-114): Member "runtimeCode" not found or not visible after argument-dependent lookup in type(contract Other).

View File

@ -11,3 +11,4 @@ contract C
// ---- // ----
// SyntaxError: (203-236): Functions without implementation cannot have modifiers. // SyntaxError: (203-236): Functions without implementation cannot have modifiers.
// SyntaxError: (241-274): Functions without implementation cannot have modifiers. // SyntaxError: (241-274): Functions without implementation cannot have modifiers.
// TypeError: (153-276): Contract "C" should be marked as abstract.

View File

@ -19,6 +19,7 @@ contract C {
function four() public pure returns (uint, uint, uint, uint); function four() public pure returns (uint, uint, uint, uint);
} }
// ---- // ----
// TypeError: (0-649): Contract "C" should be marked as abstract.
// TypeError: (47-61): Different number of components on the left hand side (1) than on the right hand side (2). // TypeError: (47-61): Different number of components on the left hand side (1) than on the right hand side (2).
// TypeError: (71-87): Different number of components on the left hand side (1) than on the right hand side (3). // TypeError: (71-87): Different number of components on the left hand side (1) than on the right hand side (3).
// TypeError: (97-112): Different number of components on the left hand side (1) than on the right hand side (4). // TypeError: (97-112): Different number of components on the left hand side (1) than on the right hand side (4).

View File

@ -19,6 +19,7 @@ contract C {
function five() public pure returns (uint, uint, uint, uint, uint); function five() public pure returns (uint, uint, uint, uint, uint);
} }
// ---- // ----
// TypeError: (0-704): Contract "C" should be marked as abstract.
// TypeError: (53-72): Different number of components on the left hand side (2) than on the right hand side (3). // TypeError: (53-72): Different number of components on the left hand side (2) than on the right hand side (3).
// TypeError: (82-101): Different number of components on the left hand side (2) than on the right hand side (3). // TypeError: (82-101): Different number of components on the left hand side (2) than on the right hand side (3).
// TypeError: (111-130): Different number of components on the left hand side (3) than on the right hand side (5). // TypeError: (111-130): Different number of components on the left hand side (3) than on the right hand side (5).

View File

@ -4,4 +4,5 @@ contract derived {
function foo() public { b = new base(); } function foo() public { b = new base(); }
} }
// ---- // ----
// TypeError: (104-112): Trying to create an instance of an abstract contract. // TypeError: (0-40): Contract "base" should be marked as abstract.
// TypeError: (104-112): Cannot instantiate an abstract contract.

View File

@ -2,5 +2,6 @@ contract base { function foo() public; }
contract derived is base { function foo() public override {} } contract derived is base { function foo() public override {} }
contract wrong is derived { function foo() public; } contract wrong is derived { function foo() public; }
// ---- // ----
// TypeError: (0-40): Contract "base" should be marked as abstract.
// TypeError: (132-154): Overriding function is missing 'override' specifier. // TypeError: (132-154): Overriding function is missing 'override' specifier.
// TypeError: (132-154): Redeclaring an already implemented function as abstract // TypeError: (132-154): Redeclaring an already implemented function as abstract

View File

@ -2,3 +2,5 @@ contract M {
function f(uint[] memory) public; function f(uint[] memory) public;
function f(int[] memory) public; function f(int[] memory) public;
} }
// ----
// TypeError: (0-89): Contract "M" should be marked as abstract.

View File

@ -9,3 +9,4 @@ contract C is I {
} }
} }
// ---- // ----
// TypeError: (110-170): Contract "C" should be marked as abstract.

Some files were not shown because too many files have changed in this diff Show More