Disallow conversions between declaration function types.

This commit is contained in:
Daniel Kirchner
2023-07-17 18:33:07 +02:00
committed by Kamil Śliwak
parent 755110aed4
commit 0ab0842c29
4 changed files with 29 additions and 0 deletions
@@ -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().
@@ -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);
}
}
// ----