mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge remote-tracking branch 'origin/develop' into HEAD
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
abstract contract A { modifier mod(uint a) virtual;}
|
||||
contract B is A { modifier mod(uint a) override { _; } }
|
||||
|
||||
abstract contract C {
|
||||
modifier m virtual;
|
||||
function f() m public {
|
||||
|
||||
}
|
||||
}
|
||||
contract D is C {
|
||||
modifier m override {
|
||||
_;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
contract A {modifier m virtual;}
|
||||
|
||||
abstract contract B {modifier m virtual;}
|
||||
contract C is B { }
|
||||
|
||||
abstract contract D {modifier m;}
|
||||
// ----
|
||||
// TypeError: (0-32): Contract "A" should be marked as abstract.
|
||||
// TypeError: (76-95): Contract "C" should be marked as abstract.
|
||||
// TypeError: (118-129): Modifiers without implementation must be marked virtual.
|
||||
@@ -0,0 +1,31 @@
|
||||
abstract contract A {
|
||||
function foo() public virtual;
|
||||
function foo(uint x) virtual public returns(uint);
|
||||
modifier mod() virtual;
|
||||
}
|
||||
|
||||
contract B is A {
|
||||
function foo(uint x) override public returns(uint) {return x;}
|
||||
modifier mod() override { _; }
|
||||
}
|
||||
|
||||
contract C is A {
|
||||
function foo() public override {}
|
||||
modifier mod() override { _; }
|
||||
}
|
||||
|
||||
contract D is A {
|
||||
function foo() public override {}
|
||||
function foo(uint x) override public returns(uint) {return x;}
|
||||
}
|
||||
|
||||
/* No errors */
|
||||
contract E is A {
|
||||
function foo() public override {}
|
||||
function foo(uint x) override public returns(uint) {return x;}
|
||||
modifier mod() override { _;}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (137-254): Contract "B" should be marked as abstract.
|
||||
// TypeError: (256-344): Contract "C" should be marked as abstract.
|
||||
// TypeError: (346-466): Contract "D" should be marked as abstract.
|
||||
@@ -0,0 +1,29 @@
|
||||
contract C {
|
||||
function f0() public { (()) = 2; }
|
||||
|
||||
function f1() public pure { (()) = (); }
|
||||
|
||||
//#8711
|
||||
function f2() internal pure returns (uint, uint) { return () = f2(); }
|
||||
|
||||
//#8277
|
||||
function f3()public{return()=();}
|
||||
|
||||
//#8277
|
||||
function f4 ( bytes32 hash , uint8 v , bytes32 r , bytes32 s , uint blockExpired , bytes32 salt ) public returns ( address ) {
|
||||
require ( ( ( ) ) |= keccak256 ( abi . encodePacked ( blockExpired , salt ) ) ) ;
|
||||
return ecrecover ( hash , v , r , s ) ;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (41-43): Empty tuple on the left hand side.
|
||||
// TypeError: (47-48): Type int_const 2 is not implicitly convertible to expected type tuple().
|
||||
// TypeError: (86-88): Empty tuple on the left hand side.
|
||||
// TypeError: (173-175): Empty tuple on the left hand side.
|
||||
// TypeError: (178-182): Type tuple(uint256,uint256) is not implicitly convertible to expected type tuple().
|
||||
// TypeError: (166-182): Different number of arguments in return statement than in returns declaration.
|
||||
// TypeError: (229-231): Empty tuple on the left hand side.
|
||||
// TypeError: (401-404): Empty tuple on the left hand side.
|
||||
// TypeError: (399-466): Compound assignment is not allowed for tuple types.
|
||||
// TypeError: (410-466): Type bytes32 is not implicitly convertible to expected type tuple().
|
||||
// TypeError: (389-396): No matching declaration found after argument-dependent lookup.
|
||||
Reference in New Issue
Block a user