Patrick wrote:

Somehow I read these as though the original poster was correct --
i.e., one creates a class method for FooClass as either

    method greet(Class $class:) { say "Hello!"; }

Yes. That will work, but it's not the recommended solution.


    method greet(FooClass $class:) { say "Hello!"; }

No. That needs to be:

      method greet(FooClass ::class:) { say "Hello!"; }

(as implied by "takes a class as its invocant" in S12).

Are the design documents out of date in this regard?  If so, can
someone provide a patch, if not, can someone confirm that the design
documents are correct?  (I just happened to be looking at class methods
this past week, which is why I was a little surprised by Luke and Damian's answers... :-)

Both documents are correct, but S12 is correcter (as you would expect).


Reply via email to