Add override exception for interface functions.

This commit is contained in:
chriseth
2021-08-31 10:45:31 +02:00
parent 78afd71ab7
commit f7916f2940
22 changed files with 83 additions and 38 deletions
@@ -0,0 +1,8 @@
abstract contract I {
function f() external virtual;
}
contract C is I {
function f() external {}
}
// ----
// TypeError 9456: (75-99): Overriding function is missing "override" specifier.
@@ -0,0 +1,19 @@
interface I {
function f() external;
function g() external;
function h() external;
}
interface J {
function f() external;
function g() external;
function h() external;
}
contract C is I, J {
function f() external {}
function g() external override {}
function h() external override(I) {}
}
// ----
// TypeError 4327: (198-222): Function needs to specify overridden contracts "I" and "J".
// TypeError 4327: (246-254): Function needs to specify overridden contracts "I" and "J".
// TypeError 4327: (281-292): Function needs to specify overridden contract "J".
@@ -0,0 +1,11 @@
interface I {
function f() external;
function g() external;
function h() external;
}
contract C is I {
function f() external {}
function g() external override {}
function h() external override(I) {}
}
// ----