Compile-time errors
What is refused before the program runs, and which exception says so.
126 rules from 86 tests. 72 of those tests are confirmed on both engines: Raku++ and Rakudo 2026.11 both pass, or Raku++ gives Rakudo's answer on every probe of a family. The verdict is the test's, not each rule's. How to read a case.
adverb-and-infixRaku++ matches Rakudo on 61 of 84 probes- 3
A symbolic infix standing where a term is expected is refused at compile time, for every infix.
check-undeclaredRaku++ matches Rakudo on 17 of 35 probes- 2
-creports an undeclared routine or type in every block, not only among top-level statements.
adverb-on-literal-and-word-infix-after-commaRaku++ passesRakudo passes- 1
An adverb after a term that no operator made modifies nothing and is refused at compile time.
42:foois refusedAlso held by
adverb-and-infix,adverb-on-a-term,term-or-operator. - 2
An infix spelled as a word, standing where a term is expected, is read as a name there, so it is an undeclared routine unless something declares one.
say 1, 2, and 3is refused rather than read as(say 1, 2) and 3Also held by
adverb-and-infix,term-or-operator,word-infix-in-term-position.
arity-lax-callersRaku++ passesRakudo does not pass- 1
A direct call whose literal arguments can never bind the sub's declared signature is a compile-time error ("Calling foo(...) will never work with declared signature (...)").
More from this test: Signatures & dispatch (3), Syntax & parsing (1).
arity-with-named-arg-at-run-timeRaku++ passesRakudo passes- 2
A call with no named argument and the wrong number of positionals is refused at compile time with "Calling g() will never work with declared signature (@l)".
More from this test: Signatures & dispatch (1).
array-op-args-getc-get-and-friendsRaku++ passesRakudo passes- 1
pop(),shift(),push()andunshift()with no argument are refused at compile time with X::TypeCheck::Argument.pop()does not answer Any
More from this test: Hashes & sets (1), I/O & processes (1), Numerics (1), Classes, roles & the MOP (1), Signatures & dispatch (2).
attr-default-block-placeholderRaku++ passesRakudo passes- 2
A placeholder variable in an attribute default that is not inside a block literal, or is inside a block that runs in place (
do,try,gather) or already has a signature, is a compile-time error.
More from this test: Classes, roles & the MOP (1).
audited-language-gaps-2Raku++ passesRakudo passes- 12
A
protobeside a plain sub of the same name is a redeclaration. - 13
A variable bound twice across nested sub-signatures is a redeclaration.
More from this test: Containers & assignment (1), Dates & times (1), Lists & laziness (3), Operators (1), Regexes & grammars (2), Strings & Unicode (2), Types & coercion (1).
audited-language-gaps-4Raku++ passesRakudo passes- 5
do 1 if $x if $xis a syntax error, as two statement modifiers on a statement are.
More from this test: Hashes & sets (1), Classes, roles & the MOP (1), Everything else (2).
begin-time-failure-wrappedRaku++ passesRakudo passesc-style-ternary-refusedRaku++ passesRakudo passes- 1
C's conditional
cond ? a : bis refused at compile time: an infix?followed by a:before the next;is an unsupported use of?and:for the ternary operator.my $s = $n > 2 ? "many" : "few"fails with "Unsupported use of ? and : for the ternary conditional operator. In Raku please use: ?? and !!."
More from this test: Operators (1).
categorical-method-nameRaku++ passesRakudo passes- 2
A sub declared with an unknown category,
sub mod:<null>, is anX::Syntax::Extension::Categoryerror.
More from this test: Classes, roles & the MOP (1).
check-mode-undeclared-routineRaku++ passesRakudo cannot run it- 1
A call to an undeclared routine is a compile-time error, reported before the program's first statement runs and by
-cwith exit status 1.say "start"; no-such-routine(1)under-cdoes not print "Syntax OK"Also held by
check-undeclared.
comma-before-assign-is-an-errorRaku++ passesRakudo passes- 1
A trailing comma before an assignment infix, as in the spaced
%h , = 5 => 4, is a compile-time error saying a term was expected.%h , = 5 => 4is refused before the program runs
compile-adhoc-does-x-compRaku++ passesRakudo passescorpus-batch-2Raku++ passesRakudo passes- 3
A bare anonymous
$used alone in sink context produces a warning. inferred
More from this test: Regexes & grammars (2), Scoping & phasers (1).
declarations-rakudo-refusesRaku++ passesRakudo passes- 1
has $.x!is refused at compile time. - 2
An attributive parameter in a signature where no
selfis available is refused. - 3
A spaced
< 1/2>literal in a signature is refused. - 4
A default value on a required parameter is refused.
- 5
A placeholder variable in a method is refused.
More from this test: Native types & NativeCall (1).
do-while-is-obsoleteRaku++ passesRakudo passes- 1
do { ... } while CONDis refused at compile time with X::Obsolete."Unsupported use of do...while. In Raku please use: repeat...while or repeat...until"
eval-undeclared-routine-reportRaku++ passesRakudo passes- 1
An undeclared routine inside an
EVALsnippet is reported in the same words as in the main program: "Undeclared routine:" followed by the name, the line it is used at and a "Did you mean" suggestion.EVAL 'prnt 1'reports "Undeclared routine:\n prnt used at line 1. Did you mean 'print'?\n" - 2
All undeclared routine names in an
EVALsnippet are reported together in one error headed "Undeclared routines:". - 3
An
EVALsnippet that calls an undeclared routine is refused before any statement of the snippet runs. - 4
When an
EVALsnippet has both an undeclared variable and an undeclared routine, the undeclared variable is reported first.
eval-undeclared-variable-before-routineRaku++ passesRakudo passes- 1
A compilation unit with both an undeclared variable and an undeclared routine is refused for the variable (X::Undeclared), since undeclared routines are reported only at the end of the compilation.
EVAL '{ my $var = 42 }; nope $var'throws X::Undeclared
gobbled-block-refused-at-compile-timeRaku++ passesRakudo passes- 1
An undeclared type-like name before the block of
if,elsif,unless,while,for,given,withorwhenis refused when the program compiles, under-cand in an EVAL too.CATCH { when X::Y {} }: "Function 'X::Y' needs parens to avoid gobbling block (or perhaps it's a class that's not declared or available in this scope?)"
More from this test: divergences (1).
grand-review-b-parserRaku++ passesRakudo passes- 3
A radix-prefixed integer literal containing a digit invalid for its radix does not compile.
0b12,0o89and0xfgare rejected - 8
An angle subscript
%x<with no closing>is a syntax error. inferred - 12
A heredoc opened on the last line of the source, with no body or terminator, is an error rather than an empty string. inferred
More from this test: Lists & laziness (1), Regexes & grammars (2), Signatures & dispatch (1), Strings & Unicode (1), Syntax & parsing (5).
grand-review-c3b-subscriptsRaku++ passesRakudo passes- 2
A literal negative subscript
@a[-1]is refused at compile time; indexing from the end is spelled*-N.
More from this test: Lists & laziness (1).
grand-review-e-regexRaku++ passesRakudo passes- 7
An unknown backslash escape in a regex is a compile-time error.
/\y/does not compile
More from this test: Regexes & grammars (7), divergences (1).
import-over-local-routineRaku++ passesRakudo passes- 1
A routine a
useorimportbrings into a scope that declares the same name is X::Redeclaration, in either order, forsub,my subandour sub, in a module, the mainline, a block, a routine, or a class or package body.use Other; sub run-word {…}: "Redeclaration of symbol '&run-word'." - 3
A
protowritten after an import of its name is a redeclaration.
More from this test: Modules (2).
interpolated-block-two-termsRaku++ passesRakudo passes- 1
A malformed
{…}block interpolated in a double-quoted string is a compile-time error, even in code that never runs.say "{1 2}"is refused as two terms in a row - 2
The position marker of a syntax error inside an interpolated
{…}block points at the term inside the string, not after the string. inferred
interpolated-variable-lineRaku++ passesRakudo passes- 1
An undeclared variable inside a string is reported at the line it is on.
"Variable '$nope' is not declared" in a string past line 200 names that line, not line 1
More from this test: Strings & Unicode (1).
is-cached-needs-experimentalRaku++ passesRakudo passes- 1
is cachedneedsuse experimental :cachedin scope; without it the trait isX::Experimental.
More from this test: Scoping & phasers (1).
issue-131-underscore-identifierRaku++ passesRakudo passes- 2
An undeclared variable whose name starts with
_($_-x,$_foo,$__) is a compile-time error; only the bare$_,@_and%_are exempt."item-$_-x"fails to compile:Variable '$_-x' is not declared
More from this test: Syntax & parsing (1).
issue-168-p5-trailing-regex-modifierRaku++ passesRakudo passes- 1
Any of the seven Perl 5 regex modifiers written tight against the closer of a regex form (
/hello/i,m/hello/is) is a compile-time error that names the first letter and its Raku spelling./hello/idoes not compile
issue-196-compile-time-call-declared-laterRaku++ passesRakudo passes- 1
Code that runs while the unit compiles (a constant's initializer, a
BEGINblock, a routine either calls) may not call a routine declared only further down: that is "Undeclared routine", X::Undeclared::Symbols, before anything runs.constant A = f(); sub f { … }is refused
issue-206-text-after-blockRaku++ passesRakudo passes- 1
A block's closing
}ends a statement by itself only at the end of its line; anywhere else the next statement needs a;, in a file and in class, role, grammar and module bodies, or the program is refused at compile time.sub f($x) { given $x { when 'a' { 'A' } when 'b' { 'B' } default { 'other' } } }is refused
More from this test: divergences (1).
keyword-named-callable-paramRaku++ passesRakudo passes- 2
With no routine of the name declared,
loop(…) { … }is refused asif(…) { … }is, read as a call ofloop().
More from this test: Syntax & parsing (1).
label-names-a-symbolRaku++ passesRakudo passes- 1
A label is a symbol of its scope: a label named
EXPORTat the top level of a program is X::Redeclaration, because the mainline has anEXPORTpackage of its own, while in a nested block, in a sub, afterunit moduleand in an EVAL it is accepted. - 2
A label and a class of the same name in one scope are a redeclaration, in either order.
lexer-line-after-backtrackRaku++ passesRakudo cannot run it- 1
A syntax error is reported at its true line even when a multi-line
< … >word list containingtoken,ruleorregexprecedes it.
list-assoc-operators-do-not-mixRaku++ passesRakudo passes- 1
A list-associative operator (
^^,min,max,andthen,notandthen,xor,orelse) after a different operator of its precedence is refused at compile time, while a left-associative one after one of them is fine.1 or 0 xor 1: "Only identical operators may be list associative; since 'or' and 'xor' differ, they are non-associative and you need to clarify with parentheses";1 xor 0 or 1is fine
literal-type-infinityRaku++ passesRakudo passes- 1
my Int $x = ∞is refused with an X::Syntax::Number::LiteralType whose.valueisInfand whose message says "(Inf)", as formy Int $x = Inf.
module-type-before-pointy-blockRaku++ passesRakudo passes- 2
A qualified name that nothing declares, written before a block, is refused as a function that needs parens to avoid gobbling the block.
CATCH { when X::Y {} }with noX::Ydeclared is that error
More from this test: Syntax & parsing (1).
named-sub-term-declares-nameRaku++ passesRakudo passes- 2
A second declaration of a name that a named
subterm declared isRedeclaration of routine.my &a = sub k {…}; my &b = sub k {…},sub k {…}besidemy &a = sub k {…}, andmy &k = sub k {…}are each a redeclaration ofk
More from this test: Classes, roles & the MOP (1), Scoping & phasers (1).
negative-subscriptRaku++ passesRakudo cannot run it- 1
A literal negative subscript such as
@a[-1]is a compile-time error (X::Obsolete);*-1is what indexes from the end.my @foo; @foo[-1] = 1does not compile
More from this test: Lists & laziness (1).
number-dot-and-bracket-infixRaku++ passesRakudo passes- 1
A dot glued to an integer literal and followed by neither a digit nor a name is the compile error "Decimal point must be followed by digit", while a name after the dot is a method call.
780.chris a method call - 2
A
[in infix position that does not spell an operator is the compile error "Missing infix inside []", while bracketed infixes at any precedence still parse.2 [&f] 3 [&f] 4and1,2 [Z*] 3,4parse
numeric-coercions-and-refusalsRaku++ passesRakudo does not pass- 6
randis a term; the call formrand(3)is rejected as the Perl 5 form rather than reported as an undeclared symbol.rand(3)is not X::Undeclared::Symbols
More from this test: Numerics (3), Types & coercion (2).
obsolete-braced-sigilRaku++ passesRakudo passes- 1
Perl 5's
"@{…}"and"${…}"inside a string are refused at compile time withX::Obsolete."x @{at}"is X::Obsolete
our-belongs-to-its-packageRaku++ passesRakudo passes- 3
An
ourvariable declared in a role's method is refused, as it is in the role body.
More from this test: Scoping & phasers (2).
package-gapsRaku++ passesRakudo passes- 2
A second
module A {}is "Redeclaration of symbol 'A'", and so is apackageafter a class or module of the name, while apackagealone is a weak declaration a later one refines.
More from this test: Modules (1), Classes, roles & the MOP (1).
package-then-role-coexistRaku++ passesRakudo passes- 2
Declaring a second
classof an existing class name, or a secondroleof an existing role name, is a redeclaration error. - 3
A
modulefollowed by aclassof the same name, and apackagefollowing aroleof the same name, are both rejected as redeclarations.
More from this test: Modules (1).
params-refuse-what-sigil-refusesRaku++ passesRakudo passes- 1
is rwon a%,@or¶meter is refused at compile time.sub f(%h is rw): "Can only use 'is rw' on a scalar ('$' sigil) parameter"
More from this test: Containers & assignment (1), Signatures & dispatch (4).
private-method-notfound-payloadRaku++ passesRakudo does not pass- 2
A call to a missing private method on
selfwritten with a literal name is a compile-time error (X::Method::NotFound+{X::Comp}), so an innertrydoes not catch it.
More from this test: Exceptions & control flow (1).
pseudo-package-beats-labelRaku++ passesRakudo passes- 2
next GLOBALunder a loop labelledGLOBALis refused at compile time.
More from this test: Exceptions & control flow (6).
qq-block-parse-error-is-reportedRaku++ passesRakudo passes- 1
Code that does not parse inside a
{ }block of an interpolating string is a compile-time error, not an empty interpolation."a {1 +} z"fails to compile: X::Comp::AdHocMissing required term after infix - 2
The compile error for a
{ }block in an interpolating string names the line the block is on, also inside a heredoc, whose body starts on the line after its opener.
qualified-constant-before-blockRaku++ passesRakudo passes- 2
A package-qualified name before a block whose package does not resolve is refused at compile time.
for Nope::x { }is refused
More from this test: Syntax & parsing (1).
rakudo-t-language-gaps-1Raku++ passesRakudo passes- 15
my :($a) = …is refused.
More from this test: Containers & assignment (1), Lists & laziness (1), Classes, roles & the MOP (2), Operators (1), Everything else (1), Regexes & grammars (2), Scoping & phasers (2), Signatures & dispatch (1), Stringification (2), Strings & Unicode (1), Syntax & parsing (1).
rakudo-t-language-gaps-2Raku++ passesRakudo passes- 12
A
QUITphaser needs a block.
More from this test: Exceptions & control flow (2), Hashes & sets (1), Lists & laziness (2), Operators (2), Regexes & grammars (4), Scoping & phasers (1), Signatures & dispatch (1), Syntax & parsing (1).
rakudo-t-language-gaps-3Raku++ passesRakudo passes- 9
A sub with a signature refuses placeholder variables, and a regex code block refuses
%_/@_. - 12
tr/a-c/with a Perl-style dash range is refused.
More from this test: Containers & assignment (1), Lists & laziness (2), Modules (1), Classes, roles & the MOP (1), Operators (2), Regexes & grammars (1), Scoping & phasers (1), Signatures & dispatch (1), Stringification (1), Syntax & parsing (1).
rakudo-t-language-gaps-4Raku++ passesRakudo passes- 6
A stub cannot replace a real routine declared before it.
More from this test: Classes, roles & the MOP (3), Operators (2), Regexes & grammars (1), Scoping & phasers (1), Stringification (1).
rakudo-t-language-gaps-5Raku++ passesRakudo passes- 5
A two-terms-in-a-row error after a multi-line quote names the line where the quote opened.
More from this test: Concurrency (1), Classes, roles & the MOP (1), Everything else (2), Signatures & dispatch (2), Stringification (1).
regex-literal-is-a-valueRaku++ passesRakudo passes- 5
A retired Perl 5 metacharacter in a regex is refused when the regex is constructed, not when it is matched.
More from this test: Regexes & grammars (4).
repl-sandbox-and-capture-scopingRaku++ passesRakudo passes- 7
An infix with no right operand reports
Missing required term after infix, and two terms on consecutive lines with no separator reportTwo terms in a row across lines.EVAL 'my $x = 42 *'fails with a message containingMissing required term after infix
More from this test: Hashes & sets (1), Regexes & grammars (4).
roast-last-filesRaku++ passesRakudo passes- 4
An undeclared type-like name before a statement's block, as in
when X::Y {}, is a compile-time error whether or not the block would run. inferredif 0 { given 1 { when Nope:D { } } }fails to compile
More from this test: Containers & assignment (2), Lists & laziness (2), Numerics (3), Classes, roles & the MOP (1), Operators (1), Scoping & phasers (2).
roast-sweep-parseRaku++ passesRakudo does not pass- 1
Declaring a
circumfixwhose name has more than two parts throwsX::Syntax::AddCategorical::TooManyParts. inferredmy constant $x = "@ µ ."; sub circumfix:<<$x>>($) { 42 }is X::Syntax::AddCategorical::TooManyParts - 4
The reverse metaoperator refuses assignment operators:
R:=andR[and]=throwX::Syntax::CannotMeta. inferred5 R:= my $xis X::Syntax::CannotMeta - 6
use lib ''with an empty string throwsX::LibEmpty. inferred - 7
A
subin a class body has noself, so$.attrinside it isX::Syntax::NoSelf. inferredclass NoSelfC { has $.b; sub bomb { "a $.b" } }is X::Syntax::NoSelf - 9
A routine trait that nothing declares is
X::Comp::Trait::Unknown. inferredsub yulia is krassivaya { }is X::Comp::Trait::Unknown
More from this test: Classes, roles & the MOP (2), Operators (1), Syntax & parsing (1).
roast-sweep-runtimeRaku++ passesRakudo cannot run it- 28
A method's parameter type must name a declared type, or the declaration is refused at compile time. inferred
- 33
A literal attribute default its type can never hold, a default on a slurpy parameter, and
:symon a sub name are refused at compile time. inferred - 35
$!ain a method with no class around it is refused. inferred - 40
An
EVALinside a method checks itsself!nameprivate-method calls as it compiles. inferred
More from this test: Concurrency (2), Containers & assignment (2), Exceptions & control flow (2), Hashes & sets (4), I/O & processes (3), Lists & laziness (5), Modules (2), Classes, roles & the MOP (8), Operators (4), Everything else (1), Regexes & grammars (1), Scoping & phasers (14), Stringification (1), Strings & Unicode (1), Types & coercion (3).
role-conflict-messageRaku++ passesRakudo passes- 1
The refusal of a method two roles bring lists the roles last-composed first.
"(C, B, A)" for
does A does B does C - 2
A multi candidate two roles bring with one signature is X::Role::Unresolved::Multi, naming the first such candidate's signature and the class that must resolve it.
"Multi method 'm' with signature :(E $:: $a, *%_)' must be resolved by class E …"
- 3
An only method from one role beside a multi of its name from another role is refused.
"Cannot have a multi candidate for 'm' when an only method is also in the package 'E'"
More from this test: Classes, roles & the MOP (1).
stash-term-before-pointy-blockRaku++ passesRakudo passes- 3
A name with a trailing
::that nothing declares, written before a block, is the "needs parens to avoid gobbling block" error.
More from this test: Syntax & parsing (2).
string-escape-past-last-codepointRaku++ passesRakudo passes- 1
A
\x[…],\o[…]or\c[…]escape naming a value past the last codepoint is a compile-time error."\x[110000]"does not compile
More from this test: Strings & Unicode (1).
string-perlish-arrow-and-colon-nameRaku++ passesRakudo passessubset-unknown-trait-and-new-type-nameRaku++ passesRakudo passes- 1
A subset's
istrait that notrait_mod:<is>candidate takes is an unknown parent, X::Inheritance::UnknownParent.subset S is no-such of Int
More from this test: Classes, roles & the MOP (1), divergences (1).
test-routine-redeclarationRaku++ passesRakudo passes- 1
A plain
sub,our subormy &named for a routine thatuse Testexports is refused at compile time, before or after theuse;use Test (),need Test, a multi, a method, an inner block's sub and a name Test does not export stay free.use Test; sub ok(…): "Redeclaration of symbol '&ok'." - 2
A routine declared twice is refused with "Redeclaration of routine 'f'. Did you mean to declare a multi-sub?", a proto declared twice and a multi beside an only sub included.
- 3
A
protodeclared after a multi of its name is refused at compile time.
trait-after-initializer-refusedRaku++ passesRakudo passes- 1
A trait written after a declaration's initializer is refused at compile time as two terms in a row, for attributes and for
my/our/constantdeclarations.has Str $.s = '' is rwdoes not compile
More from this test: Syntax & parsing (1).
type-registryRaku++ passesRakudo passes- 2
Redeclaring a type of the same name from a later
EVALis refused with X::Redeclaration, leaving the original intact;my-scoped types, stubs,augmentand parameterized roles are exempt.
More from this test: Scoping & phasers (1).
type-suggestions-native-and-termsRaku++ passesRakudo passes- 1
A misspelled type's suggestions take in the native types and the numeric terms.
class C is Strr {}suggests Str and str;Inysuggests Any, Int and Inf
undeclared-attr-sorry-bannerRaku++ passesRakudo passesundeclared-bare-namesRaku++ passesRakudo passes- 1
An unknown bare name is a compile-time error (X::Undeclared::Symbols), while a type name the unit declares further down may be referenced earlier.
say dfdfis refused with "Undeclared routine"
undeclared-in-declaration-initializerRaku++ passesRakudo passes- 1
An undeclared variable in a declaration's initializer is refused at compile time, before any statement runs.
my $y = "a $zqx b",my $y = $zqx,my $t := $zqxandmy %h = a => $zqxare refused
undeclared-operator-nameRaku++ passesRakudo cannot run it- 1
Calling or referencing an operator nobody declared by its name (
infix:<nosuch>(…),&infix:<nosuch>,&prefix:<nosuch>,&postfix:<nosuch>) is an undeclared-routine error (X::Undeclared::Symbols), refused at compile time.infix:<nosuch>(42)is refused with "Undeclared routine: infix:<nosuch>"
More from this test: Operators (1), Syntax & parsing (1).
undeclared-routine-compile-time-reportRaku++ passesRakudo passes- 1
A call to a routine nothing declares in the main program is a compile-time error under the
===SORRY!===banner that lists every such name, sorted, with the line of its use.lengthgives "Undeclared routine: length used at line 1. Did you mean 'elems', 'chars', 'codes'?" - 2
The undeclared-routine report suggests fixed hints for names other languages have (
length,bytes,break, a lower-case phaser,local,foreach,quit) and otherwise the nearest routine names, never a word operator.lenis not answered with "Did you mean 'leg'?"
undeclared-routine-referenceRaku++ passesRakudo passes- 1
A
&namereference to a routine declared nowhere is a compile-time error, "Undeclared routine: name used at line N" with suggestions, raised before any statement runs.say "hi"; say &nopeprints nothing and reports "Undeclared routine: nope used at line 1. Did you mean 'note', 'none'?" - 2
A
&namereference compiles when it names a core routine, amy &gvariable, a sub declared later in the unit, or an operator such as&infix:<+>.
undeclared-type-in-declarationRaku++ passesRakudo does not pass- 1
A declaration whose type names nothing declared, such as
my Foo $x, is refused at compile time with "Type 'Foo' is not declared".EVAL 'my int1 $var = 1'fails
undeclared-var-compile-timeRaku++ passesRakudo cannot run it- 1
An undeclared variable is a compile-time error: nothing in the unit runs.
my $x = 42; say $x; say $y; say "done";prints nothing
undeclared-variable-hintRaku++ passesRakudo passes- 1
An undeclared variable is reported with the names in scope it nearly spells, within a third of its length past the sigil, or, with none, with "Perhaps you forgot a 'sub' if this was intended to be part of a signature?".
$bazfinds$bar;$fofinds no$foo
undeclared-variable-routine-suggestionsRaku++ passesRakudo passes- 1
An undeclared variable's error suggests similarly named routines in scope, core and user-declared alike, written as
&name.$prntsuggests&print;$nopesuggests&noneand¬e;$frobbesidesub frobsuggests&frob - 2
Suggestions for an undeclared variable are scored by Levenshtein distance in which one sigil for another costs 0.5 and two switched letters cost 1.
$EVLAsuggests&EVAL - 3
.suggestionsof an undeclared-variable exception is an Array.
unknown-parent-messageRaku++ passesRakudo passes- 1
An unknown parent is reported as "'C' cannot inherit from 'nosuch' because it is unknown.", followed by a suggestion when there is one, and the exception's
.suggestionsis an Array.a suggestion reads "Did you mean 'Grammar'?"
- 2
A role's
isthat no type and notrait_mod:<is>candidate answers is an unknown parent.role R is nosuch {}androle R is Nosuch {}are refused
More from this test: Classes, roles & the MOP (1).
unterminated-quotes-at-eofRaku++ passesRakudo cannot run it- 1
A delimited construct that never closes — a string or
q//literal, a bare/…/regex, an embedded comment, a pod block, a< … >word list — is a compile-time error that names the line it opened on.say "Hello"; say "unterminateddoes not compile and prints nothing - 2
An unterminated bare quote is reported as "Unable to parse expression in double quotes; couldn't find final '"'", and an unterminated bracketed form as "Couldn't find terminator ]".
More from this test: divergences (1).
use-v6e-needs-previewRaku++ passesRakudo passeswill-never-work-compile-timeRaku++ passesRakudo passes- 1
A call to a sub the unit declares, whose positional arguments have compile-time-known types that the signature can never bind, is a compile-time error even inside
tryor a block.sub f(Str $x) { }; try f(42)runs nothing:Calling f(Int) will never work with declared signature (Str $x) - 2
A call with no arguments to a sub whose signature has a required named parameter is refused at compile time.
needs()againstsub needs(:$name!)does not compile
wordquote-colonpair-bracketRaku++ passesRakudo passes- 5
A negated or numeric-prefixed colonpair followed by a value group,
:!x[1]or:42x<a>, is a compile error.
More from this test: Syntax & parsing (4).
xblock-listop-in-conditionRaku++ passesRakudo passes- 2
When a listop in a statement condition has taken the only block, the program is refused at compile time with an X::Comp::Group whose sorrow is X::Syntax::BlockGobbled and whose panic is X::Syntax::Missing.
if bar { say "t" }fails with "Function 'bar' needs parens to avoid gobbling block" and "Missing block (apparently claimed by 'bar')"
More from this test: Syntax & parsing (2).