Documentation for method package

Documentation for method package, assembled from the following types:

class Attribute

From Attribute

(Attribute) method package

Defined as:

method package(Attribute:D: --> Mu:U)

Returns the package (class/grammar/role) to which this attribute belongs.

class Boo {
    has @!baz;
my $a = Boo.^attributes(:local)[0];
say $a.package;         # OUTPUT: «(Boo)␤» 

class Routine

From Routine

(Routine) method package

method package(Routine:D:)

Returns the package in which the routine is defined.

class X::Augment::NoSuchType

From X::Augment::NoSuchType

(X::Augment::NoSuchType) method package

Returns the name that was tried to augment, but which doesn't exist.