jeff-jenness / close

Automatically exported from code.google.com/p/close
0 stars 0 forks source link

Methods are not added to class. #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
{{{
class C {
  void greeting() :method { say("Hello, world"); }
}

void main() :main {
  pmc c = C.new();
  c.greeting();
}
}}}

This should print Hello world, but instead fails because 
  {{{
  Method 'greeting' not found for invocant of class 'C'
  }}}

Apparently, the P6object new_class doesn't do quite enough. There may
be a methods arg, or maybe I need to just generate addmethod calls either
on the class object or on the proto.

Original issue reported on code.google.com by austin_h...@yahoo.com on 26 Jun 2009 at 8:33

GoogleCodeExporter commented 9 years ago

Original comment by austin_h...@yahoo.com on 26 Jun 2009 at 8:42

GoogleCodeExporter commented 9 years ago
In fact, method needs the :method adverb. It was missing from the test case.

Original comment by austin_h...@yahoo.com on 26 Jun 2009 at 9:09