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

EditButtonTip 2019-08-04

class X::Declaration::Scope

Compilation error due to a declaration with an ineligible scope

class X::Declaration::Scope does X::Comp { }
Code

Compile time error thrown when a declaration does not harmonize with the declared scope.

For example

has sub f() { }
Code

dies with

===SORRY!===
Cannot use 'has' with sub declaration
Code

Methods§

method scope§

method scope(--> Str:D)
Code

Returns a string representation of the scope, usually the same keyword that is used for the declaration ("my", "our", "has", ...);

method declaration§

method declaration(--> Str:D)
Code

Describes the symbol that has been declared in a wrong scope.