Only check tuples for valid rational numbers if they have more than one element.

This commit is contained in:
chriseth
2017-10-17 19:14:49 +02:00
parent c99d2aae04
commit 8a8a71de84
2 changed files with 18 additions and 2 deletions
+1 -1
View File
@@ -1295,7 +1295,7 @@ bool TypeChecker::visit(TupleExpression const& _tuple)
types.push_back(type(*components[i]));
// Note: code generation will visit each of the expression even if they are not assigned from.
if (types[i]->category() == Type::Category::RationalNumber)
if (types[i]->category() == Type::Category::RationalNumber && components.size() > 1)
if (!dynamic_cast<RationalNumberType const&>(*types[i]).mobileType())
m_errorReporter.fatalTypeError(components[i]->location(), "Invalid rational number.");