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

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

For example

has sub f() { }

dies with

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

Methods§

method scope§

method scope(--> Str:D)

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)

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

Typegraph§

Type relations for X::Declaration::Scope
raku-type-graph X::Declaration::Scope X::Declaration::Scope Exception Exception X::Declaration::Scope->Exception X::Comp X::Comp X::Declaration::Scope->X::Comp Mu Mu Any Any Any->Mu Exception->Any X::Comp->Exception X::Declaration::Scope::Multi X::Declaration::Scope::Multi X::Declaration::Scope::Multi->X::Declaration::Scope

Expand chart above