=begin pod :kind("Type") :subkind("class") :category("exception")

=TITLE class X::Declaration::Scope

=SUBTITLE Compilation error due to a declaration with an ineligible scope

=for code
class X::Declaration::Scope does X::Comp { }

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

For example

=for code :skip-test<compile time error>
has sub f() { }

dies with

=for code :lang<text>
===SORRY!===
Cannot use 'has' with sub declaration

=head1 Methods

=head2 method scope

    method scope(--> Str:D)

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

=head2 method declaration

    method declaration(--> Str:D)

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

=end pod
