aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/ast
diff options
context:
space:
mode:
authorJason Cobb <jason.e.cobb@gmail.com>2018-04-11 05:35:15 +0800
committerchriseth <chris@ethereum.org>2018-04-11 18:03:08 +0800
commit3b7b962b663b493ad876a084fea72a3b747ce9e8 (patch)
treeeb387d20447d93f20831bef6458540d1e2f3aa47 /libsolidity/ast
parent41d81a7432caac39fa420ab6b761a35221710171 (diff)
downloaddexon-solidity-3b7b962b663b493ad876a084fea72a3b747ce9e8.tar.gz
dexon-solidity-3b7b962b663b493ad876a084fea72a3b747ce9e8.tar.zst
dexon-solidity-3b7b962b663b493ad876a084fea72a3b747ce9e8.zip
Fix bug in typechecking when comparing rational literals
Diffstat (limited to 'libsolidity/ast')
-rw-r--r--libsolidity/ast/Types.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp
index de359ec6..21353080 100644
--- a/libsolidity/ast/Types.cpp
+++ b/libsolidity/ast/Types.cpp
@@ -839,10 +839,10 @@ TypePointer RationalNumberType::binaryOperatorResult(Token::Value _operator, Typ
{
if (_other->category() == Category::Integer || _other->category() == Category::FixedPoint)
{
- auto mobile = mobileType();
- if (!mobile)
+ auto commonType = Type::commonType(shared_from_this(), _other);
+ if (!commonType)
return TypePointer();
- return mobile->binaryOperatorResult(_operator, _other);
+ return commonType->binaryOperatorResult(_operator, _other);
}
else if (_other->category() != category())
return TypePointer();