All explicit address conversions return a non-payable address

This commit is contained in:
hrkrshnn
2020-12-14 18:41:27 +01:00
parent 88c99a7538
commit f30c7cbac8
3 changed files with 17 additions and 12 deletions
-11
View File
@@ -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;
}