Camelia

class X::Method::Private::Permission

src
    class X::Method::Private::Permission does X::Comp { }

 
Compile time error thrown when the code contains a call to a private method that isn't defined in the current class, and when no appropriate trusts relation is defined that permits the private method call. For example the code
    1!Int::foo

 
dies with
    ===SORRY!===
    Cannot call private method 'foo' on package Int because it does not trust GLOBAL

 

Methods

method

    method method() returns Str:D

 
The name of the private method

source-package

    method source-package() returns Mu:D

 
Returns the type object that (supposedly) contains the private method.

calling-package

    method calling-package() returns Mu:D

 
Returns the package in which the calling code is, and which the source package does not trust.

Perl 6 Tricks and Treats newsletter

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