class X::Attribute::Package does X::Comp { }

Compile time error, thrown when the compiler encounters an attribute declaration inside a package that does not support attributes.

For example

module A { has $.x }

dies with

A module cannot have attributesbut you tried to declare '$.x'


method name§

method name(--> Str:D)

Returns the name of the attribute that triggered this error.

method package-kind§

method package-kind(--> Str:D)

Returns the kind of package (package, module) that doesn't support attributes.


Type relations for X::Attribute::Package
raku-type-graph X::Attribute::Package X::Attribute::Package Exception Exception X::Attribute::Package->Exception X::Comp X::Comp X::Attribute::Package->X::Comp Mu Mu Any Any Any->Mu Exception->Any X::Comp->Exception

Expand chart above