compiler: Fix struct inheriting interface with varargs method.
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Mar 2012 16:06:10 +0000 (16:06 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Mar 2012 16:06:10 +0000 (16:06 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185060 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/go/gofrontend/types.cc

index 3c33a6d..d3a75f4 100644 (file)
@@ -3744,8 +3744,12 @@ Function_type::copy_with_receiver(Type* receiver_type) const
   go_assert(!this->is_method());
   Typed_identifier* receiver = new Typed_identifier("", receiver_type,
                                                    this->location_);
-  return Type::make_function_type(receiver, this->parameters_,
-                                 this->results_, this->location_);
+  Function_type* ret = Type::make_function_type(receiver, this->parameters_,
+                                               this->results_,
+                                               this->location_);
+  if (this->is_varargs_)
+    ret->set_is_varargs();
+  return ret;
 }
 
 // Make a function type.