Refactoring of errors and fixes for various ICEs.

This commit is contained in:
Daniel Kirchner
2020-04-16 16:42:12 +02:00
parent df1809f8da
commit b744a56801
16 changed files with 127 additions and 38 deletions
+7 -4
View File
@@ -706,6 +706,9 @@ public:
/// never change the contents of the original value.
bool isPointer() const;
/// @returns true if this is valid to be stored in data location _loc
virtual BoolResult validForLocation(DataLocation _loc) const = 0;
bool operator==(ReferenceType const& _other) const
{
return location() == _other.location() && isPointer() == _other.isPointer();
@@ -772,8 +775,7 @@ public:
TypePointer decodingType() const override;
TypeResult interfaceType(bool _inLibrary) const override;
/// @returns true if this is valid to be stored in calldata
bool validForCalldata() const;
BoolResult validForLocation(DataLocation _loc) const override;
/// @returns true if this is a byte array or a string
bool isByteArray() const { return m_arrayKind != ArrayKind::Ordinary; }
@@ -827,8 +829,7 @@ public:
bool canLiveOutsideStorage() const override { return m_arrayType.canLiveOutsideStorage(); }
std::string toString(bool _short) const override;
/// @returns true if this is valid to be stored in calldata
bool validForCalldata() const { return m_arrayType.validForCalldata(); }
BoolResult validForLocation(DataLocation _loc) const override { return m_arrayType.validForLocation(_loc); }
ArrayType const& arrayType() const { return m_arrayType; }
u256 memoryDataSize() const override { solAssert(false, ""); }
@@ -934,6 +935,8 @@ public:
Type const* encodingType() const override;
TypeResult interfaceType(bool _inLibrary) const override;
BoolResult validForLocation(DataLocation _loc) const override;
bool recursive() const;
std::unique_ptr<ReferenceType> copyForLocation(DataLocation _location, bool _isPointer) const override;