void
Expression::unused_value_error()
{
- this->report_error(_("value computed is not used"));
+ if (this->type()->is_error())
+ {
+ go_assert(saw_errors());
+ this->set_is_error();
+ }
+ else
+ this->report_error(_("value computed is not used"));
}
// Note that this expression is an error. This is called by children
{ }
void
- do_check_types(Gogo*)
- { this->report_error(_("invalid use of type")); }
+ do_check_types(Gogo*);
Expression*
do_copy()
Type* type_;
};
+void
+Type_expression::do_check_types(Gogo*)
+{
+ if (this->type_->is_error())
+ {
+ go_assert(saw_errors());
+ this->set_is_error();
+ }
+ else
+ this->report_error(_("invalid use of type"));
+}
+
void
Type_expression::do_dump_expression(Ast_dump_context* ast_dump_context) const
{
else if (this->find_method(p->name()) == NULL)
this->all_methods_->push_back(*p);
else
- go_error_at(p->location(), "duplicate method %qs",
- Gogo::message_name(p->name()).c_str());
+ {
+ go_error_at(p->location(), "duplicate method %qs",
+ Gogo::message_name(p->name()).c_str());
+ this->set_is_error();
+ }
}
std::vector<Named_type*> seen;
if (it == NULL)
{
if (!t->is_error())
- go_error_at(tl, "interface contains embedded non-interface");
+ {
+ go_error_at(tl, "interface contains embedded non-interface");
+ this->set_is_error();
+ }
continue;
}
if (it == this)
if (!issued_recursive_error)
{
go_error_at(tl, "invalid recursive interface");
+ this->set_is_error();
issued_recursive_error = true;
}
continue;
if (*q == nt)
{
go_error_at(tl, "inherited interface loop");
+ this->set_is_error();
break;
}
}
q->type(), tl));
else if (!Type::are_identical(q->type(), oldm->type(),
Type::COMPARE_TAGS, NULL))
- go_error_at(tl, "duplicate method %qs",
- Gogo::message_name(q->name()).c_str());
+ {
+ go_error_at(tl, "duplicate method %qs",
+ Gogo::message_name(q->name()).c_str());
+ this->set_is_error();
+ }
}
}