perl6/doc/lib/X/Syntax/NoSelf

doc src
(title) class X::Syntax::NoSelf
    class X::Syntax::NoSelf does X::Syntax { }

 
Compile time error thrown when $.foo style calls are used where no invocant is available. For example the code
    $.meth

 
in the mainline throws the error
    ===SORRY!===
    Variable $.meth used where no 'self' is available

 
because $.meth is short for $(self.meth) , and there is no self available in mainline.

Methods

(head2) variable
Returns the variable/method call that caused the error.

Perl 6 Tricks and Treats newsletter

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