BrowserREPL-button-tip-on BrowserREPL-button-tip-off

EditButtonTip 2019-08-04

class X::Attribute::Package

Compilation error due to declaring an attribute in an ineligible package

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

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 }
Code

dies with

A module cannot have attributes, but you tried to declare '$.x'
Code

Methods§

method name§

method name(--> Str:D)
Code

Returns the name of the attribute that triggered this error.

method package-kind§

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

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