[cond-expr] change the end to end test

This commit is contained in:
Lu Guanqun committed 2016-01-22 17:14:01 +00:00
1 parent ac3019298a
commit c8b0533933
2 files changed
+11 -6

No files matched your search

+6 -2
View File
@@ -758,8 +758,12 @@ bool TypeChecker::visit(Conditional const& _conditional)
if (*trueType == *falseType)
commonType = trueType;
else
// we fake it as an equal operator, but any other comparison operator can work.
commonType = trueType->binaryOperatorResult(Token::Equal, falseType);
{
commonType = Type::commonType(trueType, falseType);
if (!commonType)
// we fake it as an equal operator, but any other comparison operator can work.
commonType = trueType->binaryOperatorResult(Token::Equal, falseType);
}
if (!commonType)
{
typeError(