@@ -1369,7 +1369,15 @@
vals->push_back(Expression::make_unary(OPERATOR_AND, s, bloc));
}
- Function_type* mtype = m->type();
+ Named_object* no = (m->needs_stub_method()
+ ? m->stub_object()
+ : m->named_object());
+
+ Function_type* mtype;
+ if (no->is_function())
+ mtype = no->func_value()->type();
+ else
+ mtype = no->func_declaration_value()->type();
gcc_assert(mtype->is_method());
Type* nonmethod_type = mtype->copy_without_receiver();
@@ -1383,8 +1391,7 @@
++p;
gcc_assert(p->field_name() == "tfn");
- vals->push_back(Expression::make_func_reference(m->named_object(), NULL,
- bloc));
+ vals->push_back(Expression::make_func_reference(no, NULL, bloc));
++p;
gcc_assert(p == fields->end());
@@ -161,6 +161,14 @@
Named_object*
named_object() const;
+ // Get the stub object.
+ Named_object*
+ stub_object() const
+ {
+ gcc_assert(this->stub_ != NULL);
+ return this->stub_;
+ }
+
// Set the stub object.
void
set_stub_object(Named_object* no)