aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorVoR0220 <catalanor0220@gmail.com>2016-05-19 04:53:36 +0800
committerVoR0220 <catalanor0220@gmail.com>2016-05-19 05:36:05 +0800
commit919235745263b36bdd7a88374b79f34214b14a5f (patch)
treedf0620df056193a27d3b7d8539680fee0ed8f0f2 /libsolidity
parent62894101529fa0ed7c7f566ea02cc805e889c745 (diff)
downloaddexon-solidity-919235745263b36bdd7a88374b79f34214b14a5f.tar
dexon-solidity-919235745263b36bdd7a88374b79f34214b14a5f.tar.gz
dexon-solidity-919235745263b36bdd7a88374b79f34214b14a5f.tar.bz2
dexon-solidity-919235745263b36bdd7a88374b79f34214b14a5f.tar.lz
dexon-solidity-919235745263b36bdd7a88374b79f34214b14a5f.tar.xz
dexon-solidity-919235745263b36bdd7a88374b79f34214b14a5f.tar.zst
dexon-solidity-919235745263b36bdd7a88374b79f34214b14a5f.zip
updated docs
types reference
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/ast/Types.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp
index e8ec32dc..d989cb06 100644
--- a/libsolidity/ast/Types.cpp
+++ b/libsolidity/ast/Types.cpp
@@ -346,9 +346,13 @@ TypePointer IntegerType::binaryOperatorResult(Token::Value _operator, TypePointe
return TypePointer();
// Nothing else can be done with addresses
if (auto intType = dynamic_pointer_cast<IntegerType const>(commonType))
+ {
if (intType->isAddress())
return TypePointer();
-
+ }
+ else if (auto fixType = dynamic_pointer_cast<FixedPointType const>(commonType))
+ if (Token::Exp == _operator)
+ return TypePointer();
return commonType;
}
@@ -436,9 +440,9 @@ string FixedPointType::toString(bool) const
TypePointer FixedPointType::binaryOperatorResult(Token::Value _operator, TypePointer const& _other) const
{
if (
- _other->category() != Category::RationalNumber
- && _other->category() != category()
- && _other->category() != Category::Integer
+ _other->category() != Category::RationalNumber &&
+ _other->category() != category() &&
+ _other->category() != Category::Integer
)
return TypePointer();
auto commonType = Type::commonType(shared_from_this(), _other); //might be fixed point or integer
@@ -452,8 +456,13 @@ TypePointer FixedPointType::binaryOperatorResult(Token::Value _operator, TypePoi
if (Token::isBitOp(_operator) || Token::isBooleanOp(_operator))
return TypePointer();
if (auto fixType = dynamic_pointer_cast<FixedPointType const>(commonType))
+ {
if (Token::Exp == _operator)
return TypePointer();
+ }
+ else if (auto intType = dynamic_pointer_cast<IntegerType const>(commonType))
+ if (intType->isAddress())
+ return TypePointer();
return commonType;
}