Allowing implicit conversion from calldata slice to memory and storage array types.

This commit is contained in:
Djordje Mijovic 2020-12-11 17:33:13 +01:00
parent e3b009d6a7
commit 0efd52a38e

View File

@ -2074,7 +2074,11 @@ std::unique_ptr<ReferenceType> ArrayType::copyForLocation(DataLocation _location
BoolResult ArraySliceType::isImplicitlyConvertibleTo(Type const& _other) const
{
if (m_arrayType.location() == DataLocation::CallData && m_arrayType.isDynamicallySized() && m_arrayType == _other)
if (
m_arrayType.dataStoredIn(DataLocation::CallData) &&
m_arrayType.isDynamicallySized() &&
m_arrayType.isImplicitlyConvertibleTo(_other)
)
return true;
return (*this) == _other;
}