diff options
Diffstat (limited to 'libsolidity/ast')
-rw-r--r-- | libsolidity/ast/Types.cpp | 13 | ||||
-rw-r--r-- | libsolidity/ast/Types.h | 4 |
2 files changed, 4 insertions, 13 deletions
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index 60b4d726..11d7160c 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -1264,17 +1264,12 @@ bool StringLiteralType::isValidUTF8() const return dev::validateUTF8(m_value); } -shared_ptr<FixedBytesType> FixedBytesType::smallestTypeForLiteral(string const& _literal) -{ - if (_literal.length() <= 32) - return make_shared<FixedBytesType>(_literal.length()); - return shared_ptr<FixedBytesType>(); -} - FixedBytesType::FixedBytesType(int _bytes): m_bytes(_bytes) { - solAssert(m_bytes >= 0 && m_bytes <= 32, - "Invalid byte number for fixed bytes type: " + dev::toString(m_bytes)); + solAssert( + m_bytes > 0 && m_bytes <= 32, + "Invalid byte number for fixed bytes type: " + dev::toString(m_bytes) + ); } bool FixedBytesType::isImplicitlyConvertibleTo(Type const& _convertTo) const diff --git a/libsolidity/ast/Types.h b/libsolidity/ast/Types.h index b41b2235..a9536657 100644 --- a/libsolidity/ast/Types.h +++ b/libsolidity/ast/Types.h @@ -505,10 +505,6 @@ class FixedBytesType: public Type public: virtual Category category() const override { return Category::FixedBytes; } - /// @returns the smallest bytes type for the given literal or an empty pointer - /// if no type fits. - static std::shared_ptr<FixedBytesType> smallestTypeForLiteral(std::string const& _literal); - explicit FixedBytesType(int _bytes); virtual bool isImplicitlyConvertibleTo(Type const& _convertTo) const override; |