Skip to content

Instantly share code, notes, and snippets.

@leonardoalt
Created January 25, 2021 13:40
Show Gist options
  • Save leonardoalt/8cdcf2aac67659b7ed7e3db9dad2116a to your computer and use it in GitHub Desktop.
Save leonardoalt/8cdcf2aac67659b7ed7e3db9dad2116a to your computer and use it in GitHub Desktop.
contract A {
uint x;
function f() internal virtual {
v();
assert(x == 0); // should fail
assert(x == 2); // should hold
}
function v() internal virtual {
x = 0;
}
}
contract A1 is A {
function f() internal virtual override {
super.f();
}
}
contract B is A {
function f() internal virtual override {
super.f();
}
}
contract C is B, A1 {
function g() public {
x = 1;
f();
}
function f() internal override(B, A1) {
super.f();
}
function v() internal override {
x = 2;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment