aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorVoR0220 <catalanor0220@gmail.com>2016-05-13 11:10:49 +0800
committerVoR0220 <catalanor0220@gmail.com>2016-05-19 04:52:09 +0800
commit3ba308fb2e4bc910e880431bc708ab4929c7aec2 (patch)
tree1955d539905dc99240bc75f1ebf733c5973c24ed /libsolidity
parent8efd6dd27a9ae1ccb8391ac326f04dff55129b5f (diff)
downloaddexon-solidity-3ba308fb2e4bc910e880431bc708ab4929c7aec2.tar
dexon-solidity-3ba308fb2e4bc910e880431bc708ab4929c7aec2.tar.gz
dexon-solidity-3ba308fb2e4bc910e880431bc708ab4929c7aec2.tar.bz2
dexon-solidity-3ba308fb2e4bc910e880431bc708ab4929c7aec2.tar.lz
dexon-solidity-3ba308fb2e4bc910e880431bc708ab4929c7aec2.tar.xz
dexon-solidity-3ba308fb2e4bc910e880431bc708ab4929c7aec2.tar.zst
dexon-solidity-3ba308fb2e4bc910e880431bc708ab4929c7aec2.zip
current debugging info
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/ast/Types.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp
index 0df68d3d..ff0db089 100644
--- a/libsolidity/ast/Types.cpp
+++ b/libsolidity/ast/Types.cpp
@@ -274,8 +274,18 @@ bool IntegerType::isImplicitlyConvertibleTo(Type const& _convertTo) const
else if (_convertTo.category() == Category::FixedPoint)
{
FixedPointType const& convertTo = dynamic_cast<FixedPointType const&>(_convertTo);
+ cout << endl;
+ cout << "Integer bits: " << m_bits << endl;
+ cout << "Fraction integer bits: " << convertTo.integerBits() << endl;
+ cout << "Integer signed: " << isSigned() << endl;
+ cout << "Fractional signed: " << convertTo.isSigned() << endl;
+ cout << "Unsigned convert?: " << bool(!convertTo.isSigned() || convertTo.integerBits() > m_bits) << endl;
+ cout << endl;
if (convertTo.integerBits() < m_bits || isAddress())
+ {
+ cout << "problem with the integer bits" << endl;
return false;
+ }
else if (isSigned())
return convertTo.isSigned();
else
@@ -328,13 +338,21 @@ string IntegerType::toString(bool) const
TypePointer IntegerType::binaryOperatorResult(Token::Value _operator, TypePointer const& _other) const
{
- if (_other->category() != Category::RationalNumber && _other->category() != category())
+ if (
+ _other->category() != Category::RationalNumber &&
+ _other->category() != Category::FixedPoint &&
+ _other->category() != category()
+ )
return TypePointer();
auto commonType = dynamic_pointer_cast<IntegerType const>(Type::commonType(shared_from_this(), _other));
if (!commonType)
+ {
+ cout << "Not common type" << endl;
return TypePointer();
-
+ }
+ cout << "Integer binary operator: " << commonType->toString(false) << endl;
+ cout << "Token: " << string(Token::toString(_operator)) << endl;
// All integer types can be compared
if (Token::isCompareOp(_operator))
return commonType;