mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Cleanup 0.5.0 test cases
This commit is contained in:
parent
74e6067347
commit
2ab66bf798
@ -1,8 +0,0 @@
|
||||
pragma experimental "v0.5.0";
|
||||
|
||||
contract C {
|
||||
function () pure returns (uint) x;
|
||||
uint constant y = x();
|
||||
}
|
||||
// ----
|
||||
// TypeError: (105-108): Initial value for constant variable has to be compile-time constant.
|
@ -1,7 +0,0 @@
|
||||
pragma experimental "v0.5.0";
|
||||
|
||||
contract A { constructor(uint) public { } }
|
||||
contract B is A(2) { constructor() public { } }
|
||||
contract C is B { constructor() A(3) public { } }
|
||||
// ----
|
||||
// DeclarationError: (156-160): Base constructor arguments given twice.
|
@ -1,6 +0,0 @@
|
||||
pragma experimental "v0.5.0";
|
||||
|
||||
contract A { constructor(uint) public { } }
|
||||
contract B is A(2) { constructor() A(3) public { } }
|
||||
// ----
|
||||
// DeclarationError: (110-114): Base constructor arguments given twice.
|
@ -1,10 +0,0 @@
|
||||
pragma experimental "v0.5.0";
|
||||
contract C
|
||||
{
|
||||
modifier only_owner() { _; }
|
||||
function foo() only_owner public;
|
||||
function bar() public only_owner;
|
||||
}
|
||||
// ----
|
||||
// SyntaxError: (80-113): Functions without implementation cannot have modifiers.
|
||||
// SyntaxError: (118-151): Functions without implementation cannot have modifiers.
|
@ -1,7 +0,0 @@
|
||||
pragma experimental "v0.5.0";
|
||||
|
||||
contract C {
|
||||
address constant x = msg.sender;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (69-79): Initial value for constant variable has to be compile-time constant.
|
@ -1,8 +0,0 @@
|
||||
pragma experimental "v0.5.0";
|
||||
contract test {
|
||||
function f() pure public {
|
||||
address(0x12).callcode;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (85-107): "callcode" has been deprecated in favour of "delegatecall".
|
@ -1,4 +1,3 @@
|
||||
pragma experimental "v0.5.0";
|
||||
contract c {
|
||||
uint8 x;
|
||||
function f() public {
|
||||
@ -6,4 +5,4 @@ contract c {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (105-106): Only local variables are supported. To access storage variables, use the _slot and _offset suffixes.
|
||||
// TypeError: (75-76): Only local variables are supported. To access storage variables, use the _slot and _offset suffixes.
|
||||
|
@ -1,4 +1,3 @@
|
||||
pragma experimental "v0.5.0";
|
||||
contract test {
|
||||
modifier m {
|
||||
uint a = 1;
|
||||
@ -11,4 +10,4 @@ contract test {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (152-181): Function state mutability can be restricted to pure
|
||||
// Warning: (122-151): Function state mutability can be restricted to pure
|
||||
|
@ -1,4 +1,3 @@
|
||||
pragma experimental "v0.5.0";
|
||||
contract test {
|
||||
uint x = 1;
|
||||
function f() public {
|
||||
@ -8,4 +7,4 @@ contract test {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (119-120): Only local variables are supported. To access storage variables, use the _slot and _offset suffixes.
|
||||
// TypeError: (89-90): Only local variables are supported. To access storage variables, use the _slot and _offset suffixes.
|
||||
|
@ -1,4 +1,3 @@
|
||||
pragma experimental "v0.5.0";
|
||||
contract test {
|
||||
uint x = 1;
|
||||
modifier m {
|
||||
@ -11,4 +10,4 @@ contract test {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (110-111): Only local variables are supported. To access storage variables, use the _slot and _offset suffixes.
|
||||
// TypeError: (80-81): Only local variables are supported. To access storage variables, use the _slot and _offset suffixes.
|
||||
|
@ -1,4 +1,3 @@
|
||||
pragma experimental "v0.5.0";
|
||||
contract test {
|
||||
uint constant x = 1;
|
||||
function f() public {
|
||||
@ -8,4 +7,4 @@ contract test {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (128-129): Constant variables not supported by inline assembly.
|
||||
// TypeError: (98-99): Constant variables not supported by inline assembly.
|
||||
|
@ -1,4 +1,3 @@
|
||||
pragma experimental "v0.5.0";
|
||||
contract test {
|
||||
uint constant x = 1;
|
||||
function f() public {
|
||||
@ -8,4 +7,4 @@ contract test {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (137-138): Constant variables not supported by inline assembly.
|
||||
// TypeError: (107-108): Constant variables not supported by inline assembly.
|
||||
|
@ -1,4 +1,3 @@
|
||||
pragma experimental "v0.5.0";
|
||||
contract test {
|
||||
function f() public {
|
||||
uint a;
|
||||
@ -8,4 +7,4 @@ contract test {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// DeclarationError: (144-145): Cannot access local Solidity variables from inside an inline assembly function.
|
||||
// DeclarationError: (114-115): Cannot access local Solidity variables from inside an inline assembly function.
|
||||
|
@ -1,4 +1,3 @@
|
||||
pragma experimental "v0.5.0";
|
||||
contract test {
|
||||
uint[] r;
|
||||
function f() public {
|
||||
@ -9,4 +8,4 @@ contract test {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// DeclarationError: (172-180): Cannot access local Solidity variables from inside an inline assembly function.
|
||||
// DeclarationError: (142-150): Cannot access local Solidity variables from inside an inline assembly function.
|
||||
|
@ -1,4 +1,3 @@
|
||||
pragma experimental "v0.5.0";
|
||||
contract test {
|
||||
uint a;
|
||||
function f() pure public {
|
||||
|
@ -1,4 +1,3 @@
|
||||
pragma experimental "v0.5.0";
|
||||
contract C {
|
||||
function f(bytes bytesAsCalldata) external {
|
||||
assembly {
|
||||
@ -7,4 +6,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (132-147): Call data elements cannot be accessed directly. Copy to a local variable first or use "calldataload" or "calldatacopy" with manually determined offsets and sizes.
|
||||
// TypeError: (102-117): Call data elements cannot be accessed directly. Copy to a local variable first or use "calldataload" or "calldatacopy" with manually determined offsets and sizes.
|
||||
|
@ -1,10 +0,0 @@
|
||||
pragma experimental "v0.5.0";
|
||||
contract C {
|
||||
function f() pure public {
|
||||
assembly {
|
||||
jump(2)
|
||||
}
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// SyntaxError: (105-112): Jump instructions and labels are low-level EVM features that can lead to incorrect stack access. Because of that they are discouraged. Please consider using "switch", "if" or "for" statements instead.
|
@ -1,11 +0,0 @@
|
||||
pragma experimental "v0.5.0";
|
||||
contract C {
|
||||
function f() pure public {
|
||||
assembly {
|
||||
mload(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// SyntaxError: (105-113): Top-level expressions are not supposed to return values (this expression returns 1 value). Use ``pop()`` or assign them.
|
||||
// DeclarationError: (91-123): Unbalanced stack at the end of a block: 1 surplus item(s).
|
@ -1,9 +0,0 @@
|
||||
pragma experimental "v0.5.0";
|
||||
contract C {
|
||||
event e();
|
||||
function f() public {
|
||||
e();
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (92-95): Event invocations have to be prefixed by "emit".
|
@ -1,4 +1,3 @@
|
||||
pragma experimental "v0.5.0";
|
||||
contract C {
|
||||
function f() public pure returns (uint, uint, bytes32) {
|
||||
uint a;
|
||||
@ -8,5 +7,5 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (133-136): Type tuple(uint256,uint256,bytes32) is not implicitly convertible to expected type tuple(uint256,).
|
||||
// TypeError: (147-150): Type tuple(uint256,uint256,bytes32) is not implicitly convertible to expected type tuple(,bytes32).
|
||||
// TypeError: (103-106): Type tuple(uint256,uint256,bytes32) is not implicitly convertible to expected type tuple(uint256,).
|
||||
// TypeError: (117-120): Type tuple(uint256,uint256,bytes32) is not implicitly convertible to expected type tuple(,bytes32).
|
||||
|
@ -1,4 +1,3 @@
|
||||
pragma experimental "v0.5.0";
|
||||
contract C {
|
||||
function g() public pure returns (
|
||||
uint,
|
||||
|
@ -1,4 +1,3 @@
|
||||
pragma experimental "v0.5.0";
|
||||
interface I {
|
||||
function f() external;
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
pragma experimental "v0.5.0";
|
||||
interface I {
|
||||
function f() public;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (45-65): Functions in interfaces must be declared external.
|
Loading…
Reference in New Issue
Block a user