perl6/doc/lib/X/Attribute/NoPackage

doc src
(title) class X::Attribute::NoPackage
    class X::Attribute::NoPackage does X::Comp { }

 
Compile time error thrown when an attribute is declared where it does not make sense (for example in the mainline). For example
    has $.x;

 
Dies with
    ===SORRY!===
    You cannot declare attribute '$.x' here; maybe you'd like a class or a role?

 

Methods

(head2) name
    method name() returns Str:D

 
Returns the name of the attribute

Perl 6 Tricks and Treats newsletter

Register to the free newsletter now, and get updates and news.
Email:
Name: