solidity/test/libsolidity/syntaxTests/modifiers/unimplemented_function_and_modifier.sol

32 lines
864 B
Solidity
Raw Normal View History

2020-04-15 09:59:47 +00:00
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 3656: (137-254): Contract "B" should be marked as abstract.
// TypeError 3656: (256-344): Contract "C" should be marked as abstract.
// TypeError 3656: (346-466): Contract "D" should be marked as abstract.