Some more tests.

This commit is contained in:
chriseth 2019-12-09 13:05:07 +01:00
parent 6d2f1f3068
commit 06e8e216b3
2 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,15 @@
contract A {
function f() external virtual {}
}
contract B {
function f() external virtual {}
}
contract C is A, B {
function f() external override (A, B);
}
contract X is C {
}
// ----
// TypeError: (120-158): Overriding an implemented function with an unimplemented function is not allowed.
// TypeError: (120-158): Overriding an implemented function with an unimplemented function is not allowed.
// TypeError: (120-158): Functions without implementation must be marked virtual.

View File

@ -0,0 +1,19 @@
interface I {
function f() external;
function g() external;
}
interface J {
function f() external;
}
abstract contract IJ is I, J {
function f() external virtual override (I, J);
}
abstract contract A is IJ
{
function f() external virtual override;
}
abstract contract B is IJ
{
function g() external override {}
}
abstract contract C is A, B {}