Fix bug in typechecking when comparing rational literals

This commit is contained in:
Jason Cobb
2018-04-11 12:03:08 +02:00
committed by chriseth
parent 41d81a7432
commit 3b7b962b66
3 changed files with 11 additions and 3 deletions
+3 -3
View File
@@ -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();