mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
All explicit address conversions return a non-payable address
This commit is contained in:
@@ -1764,17 +1764,6 @@ TypePointer TypeChecker::typeCheckTypeConversionAndRetrieveReturnType(
|
||||
result.message()
|
||||
);
|
||||
}
|
||||
if (auto addressType = dynamic_cast<AddressType const*>(resultType))
|
||||
if (addressType->stateMutability() != StateMutability::Payable)
|
||||
{
|
||||
bool payable = false;
|
||||
if (
|
||||
argType->category() != Type::Category::Address &&
|
||||
argType->category() != Type::Category::RationalNumber
|
||||
)
|
||||
payable = argType->isExplicitlyConvertibleTo(*TypeProvider::payableAddress());
|
||||
resultType = payable ? TypeProvider::payableAddress() : TypeProvider::address();
|
||||
}
|
||||
}
|
||||
return resultType;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user