Created
January 25, 2021 13:40
-
-
Save leonardoalt/8cdcf2aac67659b7ed7e3db9dad2116a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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