mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Change assertions to align to TypeChecker.
This commit is contained in:
1 parent
d479c98920
commit
64f0120622
3 files changed
+38
-12
No files matched your search
@@ -2848,17 +2848,16 @@ string YulUtilFunctions::conversionFunction(Type const& _from, Type const& _to)
|
||||
}
|
||||
else if (_from.category() == Type::Category::ArraySlice)
|
||||
{
|
||||
solAssert(_from.isDynamicallySized(), "");
|
||||
solAssert(_from.dataStoredIn(DataLocation::CallData), "");
|
||||
solAssert(_to.category() == Type::Category::Array, "");
|
||||
|
||||
auto const& fromType = dynamic_cast<ArraySliceType const&>(_from);
|
||||
auto const& targetType = dynamic_cast<ArrayType const&>(_to);
|
||||
|
||||
solAssert(!fromType.arrayType().baseType()->isDynamicallyEncoded(), "");
|
||||
solAssert(fromType.arrayType().isImplicitlyConvertibleTo(targetType), "");
|
||||
solAssert(
|
||||
*fromType.arrayType().baseType() == *targetType.baseType(),
|
||||
"Converting arrays of different type is not possible"
|
||||
fromType.arrayType().dataStoredIn(DataLocation::CallData) &&
|
||||
fromType.arrayType().isDynamicallySized() &&
|
||||
!fromType.arrayType().baseType()->isDynamicallyEncoded(),
|
||||
""
|
||||
);
|
||||
|
||||
if (!targetType.dataStoredIn(DataLocation::CallData))
|
||||
|
||||
Reference in new issue
Block a user