Merge pull request #11569 from ethereum/fixcalltounimplementedmodifier

Prevent calls to unimplemented modifiers.
This commit is contained in:
chriseth
2021-06-23 09:25:02 +02:00
committed by GitHub
3 changed files with 22 additions and 0 deletions
@@ -0,0 +1,12 @@
contract A {
modifier m() virtual { _; }
}
abstract contract B {
modifier m() virtual;
}
contract C is A, B {
modifier m() override(A, B) { _; }
function f() B.m public {}
}
// ----
// TypeError 1835: (174-177): Cannot call unimplemented modifier. The modifier has no implementation in the referenced contract. Refer to it by its unqualified name if you want to call the implementation from the most derived contract.