aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-03-19 20:05:28 +0800
committerchriseth <c@ethdev.com>2015-03-19 20:05:28 +0800
commit9e29d9797c75d6f3d3fbe0630d0af5e76fcf3afa (patch)
treec826ac679d594fbc2bad50b17920cf25b6c73f3a
parent212bff16431cf9102c221414e7b0901eed230267 (diff)
parent8e0f4c7db972950215d807bd0e17b7998e22b0db (diff)
downloaddexon-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.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/Types.cpp b/Types.cpp
index 04f86b92..4b5dddac 100644
--- a/Types.cpp
+++ b/Types.cpp
@@ -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();
}