aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/ast
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-02-04 04:34:24 +0800
committerchriseth <c@ethdev.com>2016-02-10 00:07:04 +0800
commit29faf1b298030f23076e8322dafd87df2154b40f (patch)
tree5e2d1d37aac3ab11b3015365a33f945bf9a145aa /libsolidity/ast
parentfad2d4df222f3fc306eda84a6a3842955541f9d0 (diff)
downloaddexon-solidity-29faf1b298030f23076e8322dafd87df2154b40f.tar.gz
dexon-solidity-29faf1b298030f23076e8322dafd87df2154b40f.tar.zst
dexon-solidity-29faf1b298030f23076e8322dafd87df2154b40f.zip
Index access for bytesXX.
Diffstat (limited to 'libsolidity/ast')
-rw-r--r--libsolidity/ast/Types.cpp5
-rw-r--r--libsolidity/ast/Types.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp
index 79e5bb02..01d1cb37 100644
--- a/libsolidity/ast/Types.cpp
+++ b/libsolidity/ast/Types.cpp
@@ -638,6 +638,11 @@ TypePointer FixedBytesType::binaryOperatorResult(Token::Value _operator, TypePoi
return TypePointer();
}
+MemberList::MemberMap FixedBytesType::nativeMembers(const ContractDefinition*) const
+{
+ return MemberList::MemberMap{MemberList::Member{"length", make_shared<IntegerType>(8)}};
+}
+
bool FixedBytesType::operator==(Type const& _other) const
{
if (_other.category() != category())
diff --git a/libsolidity/ast/Types.h b/libsolidity/ast/Types.h
index 723d633b..90a0509b 100644
--- a/libsolidity/ast/Types.h
+++ b/libsolidity/ast/Types.h
@@ -399,6 +399,7 @@ public:
virtual bool isValueType() const override { return true; }
virtual std::string toString(bool) const override { return "bytes" + dev::toString(m_bytes); }
+ virtual MemberList::MemberMap nativeMembers(ContractDefinition const*) const override;
virtual TypePointer encodingType() const override { return shared_from_this(); }
virtual TypePointer interfaceType(bool) const override { return shared_from_this(); }