Rules / Types, classes & roles / exception

X::Inheritance::NotComposed Reference

Error due to inheriting from a type that's not composed yet

What it is #

class from within the class body.

Routines #

Signatures are reproduced from the documentation, including their declared return types. A routine listed here is part of the type's published interface; whether Raku++ implements it is a separate question, answered by the examples below.

method child-name #

method child-name(X::Inheritance::NotComposed:D: --> Str:D)

Returns Str:D.

Returns the name of the type that tries to inherit.

method parent-name #

method parent-name(X::Inheritance::NotComposed:D: --> Str:D)

Returns Str:D.

Returns the name of the parent type that the type tries to inherit from

Examples, run three ways #

Every example below comes from the official documentation, together with the output that documentation asserts. Each was then executed by Rakudo and by Raku++ when this page was built. Where the three agree, one result is shown; where they do not, all three are — because which of them is wrong is exactly the information worth having.

5 no-output

class X::Inheritance::NotComposed is Exception {}

Not executed: the documentation states no expected output for this example.

class A { ... };    # literal ... for stubbing
class B is A { };

Not executed: the documentation states no expected output for this example.

'B' cannot inherit from 'A' because 'A' isn't composed yet (maybe it is stubbed)

Not executed: the documentation states no expected output for this example.

class Outer {
class Inner is Outer {
}
}

Not executed: the documentation states no expected output for this example.

'Outer::Inner' cannot inherit from 'Outer' because 'Outer' isn't composed yet (maybe it is stubbed)

Not executed: the documentation states no expected output for this example.