mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Relax delegatecall type restriction plus test
This commit is contained in:
parent
110e2a656d
commit
82cb5338a9
@ -3423,12 +3423,10 @@ MemberList::MemberMap FunctionType::nativeMembers(ASTNode const* _scope) const
|
||||
}
|
||||
case Kind::DelegateCall:
|
||||
{
|
||||
auto const* functionDefinition = dynamic_cast<FunctionDefinition const*>(m_declaration);
|
||||
solAssert(functionDefinition, "");
|
||||
solAssert(functionDefinition->visibility() != Visibility::Private, "");
|
||||
if (functionDefinition->visibility() != Visibility::Internal)
|
||||
if (auto const* functionDefinition = dynamic_cast<FunctionDefinition const*>(m_declaration))
|
||||
{
|
||||
auto const* contract = dynamic_cast<ContractDefinition const*>(m_declaration->scope());
|
||||
solAssert(functionDefinition->visibility() > Visibility::Internal, "");
|
||||
auto const *contract = dynamic_cast<ContractDefinition const*>(m_declaration->scope());
|
||||
solAssert(contract, "");
|
||||
solAssert(contract->isLibrary(), "");
|
||||
return {{"selector", TypeProvider::fixedBytes(4)}};
|
||||
|
@ -8,4 +8,5 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 1080: (117-130): True expression's type function D.f() does not match false expression's type function D.g().
|
||||
// TypeError 9717: (121-124): Invalid mobile type in true expression.
|
||||
// TypeError 3703: (127-130): Invalid mobile type in false expression.
|
||||
|
@ -0,0 +1,12 @@
|
||||
library L {
|
||||
function f() external {}
|
||||
}
|
||||
|
||||
contract C {
|
||||
function test() public {
|
||||
(true ? L.f : L.f).selector;
|
||||
}
|
||||
}
|
||||
|
||||
// ----
|
||||
// TypeError 9582: (94-121): Member "selector" not found or not visible after argument-dependent lookup in function ().
|
Loading…
Reference in New Issue
Block a user