Commit e3e19050 by Ian Lance Taylor

Check for error type when getting type of binary expression.

From-SVN: r169002
parent 0ca82dd6
......@@ -5396,7 +5396,11 @@ Binary_expression::do_type()
{
Type* left_type = this->left_->type();
Type* right_type = this->right_->type();
if (!left_type->is_abstract() && left_type->named_type() != NULL)
if (left_type->is_error_type())
return left_type;
else if (right_type->is_error_type())
return right_type;
else if (!left_type->is_abstract() && left_type->named_type() != NULL)
return left_type;
else if (!right_type->is_abstract() && right_type->named_type() != NULL)
return right_type;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment