mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Allow explicit conversion from address to address payable
This commit is contained in:
@@ -200,7 +200,7 @@ inline T const* TypeProvider::createAndGet(Args&& ... _args)
|
||||
return static_cast<T const*>(instance().m_generalTypes.back().get());
|
||||
}
|
||||
|
||||
Type const* TypeProvider::fromElementaryTypeName(ElementaryTypeNameToken const& _type)
|
||||
Type const* TypeProvider::fromElementaryTypeName(ElementaryTypeNameToken const& _type, boost::optional<StateMutability> _stateMutability)
|
||||
{
|
||||
solAssert(
|
||||
TokenTraits::isElementaryTypeName(_type.token()),
|
||||
@@ -233,7 +233,14 @@ Type const* TypeProvider::fromElementaryTypeName(ElementaryTypeNameToken const&
|
||||
case Token::UFixed:
|
||||
return fixedPoint(128, 18, FixedPointType::Modifier::Unsigned);
|
||||
case Token::Address:
|
||||
{
|
||||
if (_stateMutability)
|
||||
{
|
||||
solAssert(*_stateMutability == StateMutability::Payable, "");
|
||||
return payableAddress();
|
||||
}
|
||||
return address();
|
||||
}
|
||||
case Token::Bool:
|
||||
return boolean();
|
||||
case Token::Bytes:
|
||||
|
||||
Reference in New Issue
Block a user