mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Disallow conversions between declaration function types.
This commit is contained in:
committed by
Kamil Śliwak
parent
755110aed4
commit
0ab0842c29
@@ -0,0 +1,11 @@
|
||||
contract D {
|
||||
function f() external {}
|
||||
function g() external {}
|
||||
}
|
||||
contract C {
|
||||
function f(bool c) public pure {
|
||||
(c ? D.f : D.g);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 1080: (117-130): True expression's type function D.f() does not match false expression's type function D.g().
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
contract C {
|
||||
function f() internal {}
|
||||
function g() internal {}
|
||||
}
|
||||
|
||||
contract D is C {
|
||||
function h(bool b) public pure {
|
||||
(b ? C.f : C.g);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
Reference in New Issue
Block a user