diff options
author | chriseth <c@ethdev.com> | 2015-03-19 20:05:28 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-03-19 20:05:28 +0800 |
commit | 9e29d9797c75d6f3d3fbe0630d0af5e76fcf3afa (patch) | |
tree | c826ac679d594fbc2bad50b17920cf25b6c73f3a | |
parent | 212bff16431cf9102c221414e7b0901eed230267 (diff) | |
parent | 8e0f4c7db972950215d807bd0e17b7998e22b0db (diff) | |
download | dexon-solidity-9e29d9797c75d6f3d3fbe0630d0af5e76fcf3afa.tar dexon-solidity-9e29d9797c75d6f3d3fbe0630d0af5e76fcf3afa.tar.gz dexon-solidity-9e29d9797c75d6f3d3fbe0630d0af5e76fcf3afa.tar.bz2 dexon-solidity-9e29d9797c75d6f3d3fbe0630d0af5e76fcf3afa.tar.lz dexon-solidity-9e29d9797c75d6f3d3fbe0630d0af5e76fcf3afa.tar.xz dexon-solidity-9e29d9797c75d6f3d3fbe0630d0af5e76fcf3afa.tar.zst dexon-solidity-9e29d9797c75d6f3d3fbe0630d0af5e76fcf3afa.zip |
Merge pull request #1344 from LefterisJP/sol_BytesToIntConv
Explicit conversion between bytes and int of any size
-rw-r--r-- | Types.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
@@ -536,14 +536,8 @@ bool FixedBytesType::isImplicitlyConvertibleTo(Type const& _convertTo) const bool FixedBytesType::isExplicitlyConvertibleTo(Type const& _convertTo) const { - if (_convertTo.getCategory() == Category::Integer) - { - IntegerType const& convertTo = dynamic_cast<IntegerType const&>(_convertTo); - if (m_bytes * 8 <= convertTo.getNumBits()) - return true; - } - - return _convertTo.getCategory() == Category::Contract || + return _convertTo.getCategory() == Category::Integer || + _convertTo.getCategory() == Category::Contract || _convertTo.getCategory() == getCategory(); } |