class X::Placeholder::Mainline
ErrorsCollection

class X::Placeholder::Mainline

Compilation error due to a placeholder in the mainline

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

$^x;

dies with

===SORRY!===
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