|| token->is_op(OPERATOR_CHANOP))
return this->channel_type();
else if (token->is_keyword(KEYWORD_INTERFACE))
- return this->interface_type();
+ return this->interface_type(true);
else if (token->is_keyword(KEYWORD_FUNC))
{
Location location = token->location();
// MethodSpecList = MethodSpec { ";" MethodSpec } [ ";" ] .
Type*
-Parse::interface_type()
+Parse::interface_type(bool record)
{
go_assert(this->peek_token()->is_keyword(KEYWORD_INTERFACE));
Location location = this->location();
}
Interface_type* ret = Type::make_interface_type(methods, location);
- this->gogo_->record_interface_type(ret);
+ if (record)
+ this->gogo_->record_interface_type(ret);
return ret;
}
}
Type* type;
- if (!this->peek_token()->is_op(OPERATOR_SEMICOLON))
+ if (name == "_" && this->peek_token()->is_keyword(KEYWORD_INTERFACE))
+ {
+ // We call Parse::interface_type explicity here because we do not want
+ // to record an interface with a blank type name.
+ type = this->interface_type(false);
+ }
+ else if (!this->peek_token()->is_op(OPERATOR_SEMICOLON))
type = this->type();
else
{
void parameter_decl(bool, Typed_identifier_list*, bool*, bool*, bool*);
bool result(Typed_identifier_list**);
Location block();
- Type* interface_type();
+ Type* interface_type(bool record);
void method_spec(Typed_identifier_list*);
void declaration();
bool declaration_may_start_here();