compiler: fix method finalization of unnamed structs.

Used to trigger an ICE on
  var v struct{I}; type I interface{}

Updates issue 7.

From-SVN: r185932
This commit is contained in:
Ian Lance Taylor 2012-03-28 22:22:19 +00:00
parent 63135179e4
commit ad57e71d44
1 changed files with 5 additions and 1 deletions

View File

@ -1653,8 +1653,12 @@ Finalize_methods::type(Type* t)
}
case Type::TYPE_STRUCT:
// Traverse the field types first in case there is an embedded
// field with methods that the struct should inherit.
if (t->struct_type()->traverse_field_types(this) == TRAVERSE_EXIT)
return TRAVERSE_EXIT;
t->struct_type()->finalize_methods(this->gogo_);
break;
return TRAVERSE_SKIP_COMPONENTS;
default:
break;