mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add override exception for interface functions.
This commit is contained in:
+8
@@ -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.
|
||||
+19
@@ -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".
|
||||
+11
@@ -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) {}
|
||||
}
|
||||
// ----
|
||||
Reference in New Issue
Block a user