diff options
author | Christian <c@ethdev.com> | 2015-02-10 16:00:50 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2015-02-12 18:33:09 +0800 |
commit | 20b4c6900982302fd07df12e2a1f6f0e15886834 (patch) | |
tree | 3a202298db494951bb5caa6bf04f92517d525d14 /Types.cpp | |
parent | 1369337808ef5d2e4394336eec78f0cff406d55c (diff) | |
download | dexon-solidity-20b4c6900982302fd07df12e2a1f6f0e15886834.tar.gz dexon-solidity-20b4c6900982302fd07df12e2a1f6f0e15886834.tar.zst dexon-solidity-20b4c6900982302fd07df12e2a1f6f0e15886834.zip |
Tests and some code for msg.data.
Diffstat (limited to 'Types.cpp')
-rw-r--r-- | Types.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -508,6 +508,16 @@ TypePointer ContractType::unaryOperatorResult(Token::Value _operator) const return _operator == Token::Delete ? make_shared<VoidType>() : TypePointer(); } +bool ByteArrayType::isImplicitlyConvertibleTo(const Type& _convertTo) const +{ + if (*this == _convertTo) + return true; + if (_convertTo.getCategory() != Category::ByteArray) + return false; + auto const& other = dynamic_cast<ByteArrayType const&>(_convertTo); + return (m_dynamicLength == other.m_dynamicLength || m_length == other.m_length); +} + bool ByteArrayType::operator==(Type const& _other) const { if (_other.getCategory() != getCategory()) @@ -952,7 +962,9 @@ MagicType::MagicType(MagicType::Kind _kind): case Kind::Message: m_members = MemberList({{"sender", make_shared<IntegerType>(0, IntegerType::Modifier::Address)}, {"gas", make_shared<IntegerType>(256)}, - {"value", make_shared<IntegerType>(256)}}); + {"value", make_shared<IntegerType>(256)}, + {"data", make_shared<ByteArrayType>(ByteArrayType::Location::CallData, + 0, 0, true)}}); break; case Kind::Transaction: m_members = MemberList({{"origin", make_shared<IntegerType>(0, IntegerType::Modifier::Address)}, |