mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Implement and fix overriding unimplemented and implemented functions with unimplemented functions.
This commit is contained in:
committed by
chriseth
parent
2c72ee7017
commit
426f04b389
@@ -0,0 +1,15 @@
|
||||
abstract contract A {
|
||||
function f() external virtual;
|
||||
}
|
||||
abstract contract B {
|
||||
function f() external virtual {}
|
||||
}
|
||||
abstract contract C is A, B {
|
||||
function f() external virtual override(A, B);
|
||||
}
|
||||
abstract contract D is B, A {
|
||||
function f() external virtual override(A, B);
|
||||
}
|
||||
// ----
|
||||
// TypeError: (154-199): Overriding an implemented function with an unimplemented function is not allowed.
|
||||
// TypeError: (236-281): Overriding an implemented function with an unimplemented function is not allowed.
|
||||
@@ -0,0 +1,9 @@
|
||||
interface A {
|
||||
function f() external;
|
||||
}
|
||||
interface B {
|
||||
function f() external;
|
||||
}
|
||||
abstract contract C is A, B {
|
||||
function f() external virtual override(A, B);
|
||||
}
|
||||
Reference in New Issue
Block a user