class X::Placeholder::Mainline is X::Placeholder::Block { }

Thrown when a placeholder variable is used in the mainline, i.e. outside of any explicit block.

For example


dies with

Cannot use placeholder parameter $^x outside of a sub or block

Note that this error can also occur when you think something is a block, but it really is a postcircumfix:<{ }>, for example

my %h;
say %h{ $^x };
#     ^^^^^^^  not a block, so $^x is part of the mainline 


Type relations for X::Placeholder::Mainline
raku-type-graph X::Placeholder::Mainline X::Placeholder::Mainline X::Placeholder::Block X::Placeholder::Block X::Placeholder::Mainline->X::Placeholder::Block Mu Mu Any Any Any->Mu Exception Exception Exception->Any X::Comp X::Comp X::Comp->Exception X::Placeholder::Block->Exception X::Placeholder::Block->X::Comp

Expand chart above