diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2015-03-18 00:35:18 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2015-03-18 17:57:24 +0800 |
commit | 8e0f4c7db972950215d807bd0e17b7998e22b0db (patch) | |
tree | 53031705217127a0f131668cf61f4959d52bb0e0 | |
parent | ed757ba5bf1090ba8a9a5e3e6a29da8785afb861 (diff) | |
download | dexon-solidity-8e0f4c7db972950215d807bd0e17b7998e22b0db.tar dexon-solidity-8e0f4c7db972950215d807bd0e17b7998e22b0db.tar.gz dexon-solidity-8e0f4c7db972950215d807bd0e17b7998e22b0db.tar.bz2 dexon-solidity-8e0f4c7db972950215d807bd0e17b7998e22b0db.tar.lz dexon-solidity-8e0f4c7db972950215d807bd0e17b7998e22b0db.tar.xz dexon-solidity-8e0f4c7db972950215d807bd0e17b7998e22b0db.tar.zst dexon-solidity-8e0f4c7db972950215d807bd0e17b7998e22b0db.zip |
Explicit conversion between bytes and int of any size
- Allowing aforementioned conversion and adding tests for it
-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(); } |