Raku Cases › Compile-time errors

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 probes2026-11-28 · 04a1722e
  1. 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 probes2026-11-28 · 04a1722e · #264
  1. 2

    -c reports an undeclared routine or type in every block, not only among top-level statements.

adverb-on-literal-and-word-infix-after-commaRaku++ passesRakudo passes2026-11-14 · 06212d97 · rakudo#1476 · rakudo#3426 · rakudo#4107
  1. 1

    An adverb after a term that no operator made modifies nothing and is refused at compile time.

    42:foo is refused

    Also held by adverb-and-infix, adverb-on-a-term, term-or-operator.

  2. 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 3 is refused rather than read as (say 1, 2) and 3

    Also held by adverb-and-infix, term-or-operator, word-infix-in-term-position.

arity-lax-callersRaku++ passesRakudo does not pass2026-07-22 · 9227c3ee
  1. 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 passes2026-11-08 · cae1cb63
  1. 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 passes2026-09-17 · 2e994990
  1. 1

    pop(), shift(), push() and unshift() 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 passes2026-09-04 · edf6c77f · #60
  1. 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 passes2026-10-04 · 39c1aeb6
  1. 12

    A proto beside a plain sub of the same name is a redeclaration.

  2. 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 passes2026-10-05 · f3b1fe01
  1. 5

    do 1 if $x if $x is 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 passes2026-11-08 · d9fb551b
  1. 1

    What dies in a BEGIN, a CHECK or a constant's initializer is X::Comp::BeginTime, in an EVAL too.

    "An exception X::AdHoc+{X::Comp} occurred while evaluating a BEGIN:\nb"

  2. 2

    The inner exception of a failed BEGIN or constant initializer does X::Comp, while a CHECK's does not.

c-style-ternary-refusedRaku++ passesRakudo passes2026-10-23 · 93f9a4af
  1. 1

    C's conditional cond ? a : b is 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 passes2026-09-11 · cc95e49f
  1. 2

    A sub declared with an unknown category, sub mod:<null>, is an X::Syntax::Extension::Category error.

More from this test: Classes, roles & the MOP (1).

check-mode-undeclared-routineRaku++ passesRakudo cannot run it2026-11-15 · a9c5615f · #264
  1. 1

    A call to an undeclared routine is a compile-time error, reported before the program's first statement runs and by -c with exit status 1.

    say "start"; no-such-routine(1) under -c does not print "Syntax OK"

    Also held by check-undeclared.

comma-before-assign-is-an-errorRaku++ passesRakudo passes2026-09-14 · 2b013edd · #85
  1. 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 => 4 is refused before the program runs

compile-adhoc-does-x-compRaku++ passesRakudo passes2026-11-08 · c2dcfeb9
  1. 1

    An X::AdHoc the compiler raises does X::Comp, keeping its line and its payload.

    try EVAL q[sub f(%h is rw) {}]; $! ~~ X::Comp is True

  2. 2

    class GLOBAL {} is refused with X::PseudoPackage::InDeclaration, "Cannot use pseudo package GLOBAL in package name", while class GLOBAL::B {} declares B.

corpus-batch-2Raku++ passesRakudo passes2026-07-22 · c9beb901
  1. 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 passes2026-11-14 · 8f7ac1df · rakudo#1426 · rakudo#1427 · rakudo#1828 · rakudo#2320
  1. 1

    has $.x! is refused at compile time.

  2. 2

    An attributive parameter in a signature where no self is available is refused.

  3. 3

    A spaced < 1/2> literal in a signature is refused.

  4. 4

    A default value on a required parameter is refused.

  5. 5

    A placeholder variable in a method is refused.

More from this test: Native types & NativeCall (1).

do-while-is-obsoleteRaku++ passesRakudo passes2026-11-11 · ca60fcc7 · #93
  1. 1

    do { ... } while COND is 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 passes2026-11-09 · 25975633
  1. 1

    An undeclared routine inside an EVAL snippet 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. 2

    All undeclared routine names in an EVAL snippet are reported together in one error headed "Undeclared routines:".

  3. 3

    An EVAL snippet that calls an undeclared routine is refused before any statement of the snippet runs.

  4. 4

    When an EVAL snippet has both an undeclared variable and an undeclared routine, the undeclared variable is reported first.

eval-undeclared-variable-before-routineRaku++ passesRakudo passes2026-10-23 · 9d48b3b5
  1. 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 passes2026-11-08 · 422df3d1
  1. 1

    An undeclared type-like name before the block of if, elsif, unless, while, for, given, with or when is refused when the program compiles, under -c and 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 passes2026-09-06 · fa74f74f
  1. 3

    A radix-prefixed integer literal containing a digit invalid for its radix does not compile.

    0b12, 0o89 and 0xfg are rejected

  2. 8

    An angle subscript %x< with no closing > is a syntax error. inferred

  3. 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 passes2026-09-06 · fa74f74f
  1. 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 passes2026-09-06 · fa74f74f
  1. 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 passes2026-11-08 · eb574770 · #230
  1. 1

    A routine a use or import brings into a scope that declares the same name is X::Redeclaration, in either order, for sub, my sub and our 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'."

  2. 3

    A proto written after an import of its name is a redeclaration.

More from this test: Modules (2).

interpolated-block-two-termsRaku++ passesRakudo passes2026-11-12 · 64e4c44f · #260
  1. 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. 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 passes2026-11-08 · 728cf9cb
  1. 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 passes2026-11-14 · 2fe0aeeb
  1. 1

    is cached needs use experimental :cached in scope; without it the trait is X::Experimental.

More from this test: Scoping & phasers (1).

issue-131-underscore-identifierRaku++ passesRakudo passes2026-10-07 · b0fd5a32 · #131
  1. 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 passes2026-10-14 · 0820ef24 · #168
  1. 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/i does not compile

issue-196-compile-time-call-declared-laterRaku++ passesRakudo passes2026-10-29 · f303f0c0 · #196
  1. 1

    Code that runs while the unit compiles (a constant's initializer, a BEGIN block, 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 passes2026-10-27 · 2b9494ae · #206
  1. 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 passes2026-11-08 · 6497dca5
  1. 2

    With no routine of the name declared, loop(…) { … } is refused as if(…) { … } is, read as a call of loop().

More from this test: Syntax & parsing (1).

label-names-a-symbolRaku++ passesRakudo passes2026-10-09 · fadb97aa
  1. 1

    A label is a symbol of its scope: a label named EXPORT at the top level of a program is X::Redeclaration, because the mainline has an EXPORT package of its own, while in a nested block, in a sub, after unit module and in an EVAL it is accepted.

  2. 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 it2026-09-23 · c88770ca
  1. 1

    A syntax error is reported at its true line even when a multi-line < … > word list containing token, rule or regex precedes it.

list-assoc-operators-do-not-mixRaku++ passesRakudo passes2026-11-08 · a7739c52
  1. 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 1 is fine

literal-type-infinityRaku++ passesRakudo passes2026-10-23 · 9d48b3b5
  1. 1

    my Int $x = ∞ is refused with an X::Syntax::Number::LiteralType whose .value is Inf and whose message says "(Inf)", as for my Int $x = Inf.

module-type-before-pointy-blockRaku++ passesRakudo passes2026-10-30 · 7aa4256c
  1. 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 no X::Y declared is that error

More from this test: Syntax & parsing (1).

named-sub-term-declares-nameRaku++ passesRakudo passes2026-10-18 · 7d824d2b
  1. 2

    A second declaration of a name that a named sub term declared is Redeclaration of routine.

    my &a = sub k {…}; my &b = sub k {…}, sub k {…} beside my &a = sub k {…}, and my &k = sub k {…} are each a redeclaration of k

More from this test: Classes, roles & the MOP (1), Scoping & phasers (1).

negative-subscriptRaku++ passesRakudo cannot run it2026-08-26 · 76219bd3 · #36
  1. 1

    A literal negative subscript such as @a[-1] is a compile-time error (X::Obsolete); *-1 is what indexes from the end.

    my @foo; @foo[-1] = 1 does not compile

More from this test: Lists & laziness (1).

number-dot-and-bracket-infixRaku++ passesRakudo passes2026-09-21 · 9c0fc4b8
  1. 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.chr is a method call

  2. 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] 4 and 1,2 [Z*] 3,4 parse

numeric-coercions-and-refusalsRaku++ passesRakudo does not pass2026-09-22 · 7500df9e
  1. 6

    rand is a term; the call form rand(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 passes2026-10-02 · 925260b1
  1. 1

    Perl 5's "@{…}" and "${…}" inside a string are refused at compile time with X::Obsolete.

    "x @{at}" is X::Obsolete

our-belongs-to-its-packageRaku++ passesRakudo passes2026-10-21 · 8174a3c3
  1. 3

    An our variable 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 passes2026-11-08 · 85a90672
  1. 2

    A second module A {} is "Redeclaration of symbol 'A'", and so is a package after a class or module of the name, while a package alone is a weak declaration a later one refines.

More from this test: Modules (1), Classes, roles & the MOP (1).

package-then-role-coexistRaku++ passesRakudo passes2026-07-23 · 14f65181
  1. 2

    Declaring a second class of an existing class name, or a second role of an existing role name, is a redeclaration error.

  2. 3

    A module followed by a class of the same name, and a package following a role of the same name, are both rejected as redeclarations.

More from this test: Modules (1).

params-refuse-what-sigil-refusesRaku++ passesRakudo passes2026-11-08 · 0ca4968e
  1. 1

    is rw on a %, @ or & parameter 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 pass2026-08-30 · 71abc700
  1. 2

    A call to a missing private method on self written with a literal name is a compile-time error (X::Method::NotFound+{X::Comp}), so an inner try does not catch it.

More from this test: Exceptions & control flow (1).

pseudo-package-beats-labelRaku++ passesRakudo passes2026-10-07 · 3f57ed3c
  1. 2

    next GLOBAL under a loop labelled GLOBAL is refused at compile time.

More from this test: Exceptions & control flow (6).

qq-block-parse-error-is-reportedRaku++ passesRakudo passes2026-10-08 · 5ccae330 · #137
  1. 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::AdHoc Missing required term after infix

  2. 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 passes2026-11-12 · d36fb3fa
  1. 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 passes2026-10-05 · 892e6c61
  1. 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 passes2026-10-05 · e209ae16
  1. 12

    A QUIT phaser 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 passes2026-10-05 · be813251
  1. 9

    A sub with a signature refuses placeholder variables, and a regex code block refuses %_ / @_.

  2. 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 passes2026-10-05 · c5326843
  1. 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 passes2026-10-05 · 98ddcee4
  1. 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 passes2026-08-27 · 023300db · #34
  1. 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 passes2026-09-02 · 5cdc21fe
  1. 7

    An infix with no right operand reports Missing required term after infix, and two terms on consecutive lines with no separator report Two terms in a row across lines.

    EVAL 'my $x = 42 *' fails with a message containing Missing required term after infix

More from this test: Hashes & sets (1), Regexes & grammars (4).

roast-last-filesRaku++ passesRakudo passes2026-09-28 · 6e9ef4cc
  1. 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. inferred

    if 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 pass2026-09-28 · 2cc896bd
  1. 1

    Declaring a circumfix whose name has more than two parts throws X::Syntax::AddCategorical::TooManyParts. inferred

    my constant $x = "@ µ ."; sub circumfix:<<$x>>($) { 42 } is X::Syntax::AddCategorical::TooManyParts

  2. 4

    The reverse metaoperator refuses assignment operators: R:= and R[and]= throw X::Syntax::CannotMeta. inferred

    5 R:= my $x is X::Syntax::CannotMeta

  3. 6

    use lib '' with an empty string throws X::LibEmpty. inferred

  4. 7

    A sub in a class body has no self, so $.attr inside it is X::Syntax::NoSelf. inferred

    class NoSelfC { has $.b; sub bomb { "a $.b" } } is X::Syntax::NoSelf

  5. 9

    A routine trait that nothing declares is X::Comp::Trait::Unknown. inferred

    sub 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 it2026-09-28 · 2cc896bd
  1. 28

    A method's parameter type must name a declared type, or the declaration is refused at compile time. inferred

  2. 33

    A literal attribute default its type can never hold, a default on a slurpy parameter, and :sym on a sub name are refused at compile time. inferred

  3. 35

    $!a in a method with no class around it is refused. inferred

  4. 40

    An EVAL inside a method checks its self!name private-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 passes2026-11-08 · 846ae003
  1. 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. 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. 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 passes2026-11-11 · 19078698 · #238
  1. 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 passes2026-11-10 · 91f64325
  1. 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 passes2026-10-02 · 99f09017 · #109
  1. 1

    Inside a double-quoted string, -> straight after an interpolated variable is Perl's arrow and is refused with X::Obsolete.

  2. 2

    Inside a double-quoted string, $h:word continues the variable's name, so an undeclared extended name is refused at compile time.

    "$h:Set<1>" is an undeclared variable

subset-unknown-trait-and-new-type-nameRaku++ passesRakudo passes2026-11-08 · f59ff84c
  1. 1

    A subset's is trait that no trait_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 passes2026-11-08 · 483370b7
  1. 1

    A plain sub, our sub or my & named for a routine that use Test exports is refused at compile time, before or after the use; 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. 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. 3

    A proto declared after a multi of its name is refused at compile time.

trait-after-initializer-refusedRaku++ passesRakudo passes2026-10-05 · a3b7644c · #127
  1. 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/constant declarations.

    has Str $.s = '' is rw does not compile

More from this test: Syntax & parsing (1).

type-registryRaku++ passesRakudo passes2026-08-12 · 3e238862
  1. 2

    Redeclaring a type of the same name from a later EVAL is refused with X::Redeclaration, leaving the original intact; my-scoped types, stubs, augment and parameterized roles are exempt.

More from this test: Scoping & phasers (1).

type-suggestions-native-and-termsRaku++ passesRakudo passes2026-11-08 · 75213a10
  1. 1

    A misspelled type's suggestions take in the native types and the numeric terms.

    class C is Strr {} suggests Str and str; Iny suggests Any, Int and Inf

undeclared-attr-sorry-bannerRaku++ passesRakudo passes2026-07-22 · 87ebf739
  1. 1

    Using an undeclared $!attr in a class method is a compile-time error, printed under the ===SORRY!=== banner with a file and line, and the exception carries filename and line.

    a class with has $.na whose method says $!name fails to compile

undeclared-bare-namesRaku++ passesRakudo passes2026-08-12 · f9e7c867
  1. 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 dfdf is refused with "Undeclared routine"

undeclared-in-declaration-initializerRaku++ passesRakudo passes2026-11-09 · 024a0905
  1. 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 := $zqx and my %h = a => $zqx are refused

undeclared-operator-nameRaku++ passesRakudo cannot run it2026-10-20 · 145cddbf
  1. 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 passes2026-10-23 · c7a12943
  1. 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.

    length gives "Undeclared routine: length used at line 1. Did you mean 'elems', 'chars', 'codes'?"

  2. 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.

    len is not answered with "Did you mean 'leg'?"

undeclared-routine-referenceRaku++ passesRakudo passes2026-11-09 · 49808203
  1. 1

    A &name reference 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 &nope prints nothing and reports "Undeclared routine: nope used at line 1. Did you mean 'note', 'none'?"

  2. 2

    A &name reference compiles when it names a core routine, a my &g variable, a sub declared later in the unit, or an operator such as &infix:<+>.

undeclared-type-in-declarationRaku++ passesRakudo does not pass2026-09-22 · 0a267ea0
  1. 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 it2026-08-26 · 96f4335f · #32
  1. 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 passes2026-11-08 · 2108a08b
  1. 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?".

    $baz finds $bar; $fo finds no $foo

undeclared-variable-routine-suggestionsRaku++ passesRakudo passes2026-11-09 · 628ad9cb
  1. 1

    An undeclared variable's error suggests similarly named routines in scope, core and user-declared alike, written as &name.

    $prnt suggests &print; $nope suggests &none and &note; $frob beside sub frob suggests &frob

  2. 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.

    $EVLA suggests &EVAL

  3. 3

    .suggestions of an undeclared-variable exception is an Array.

unknown-parent-messageRaku++ passesRakudo passes2026-11-08 · 53837aa5
  1. 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 .suggestions is an Array.

    a suggestion reads "Did you mean 'Grammar'?"

  2. 2

    A role's is that no type and no trait_mod:<is> candidate answers is an unknown parent.

    role R is nosuch {} and role R is Nosuch {} are refused

More from this test: Classes, roles & the MOP (1).

unterminated-quotes-at-eofRaku++ passesRakudo cannot run it2026-08-03 · 34cda960
  1. 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 "unterminated does not compile and prints nothing

  2. 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 passes2026-11-14 · 9f94cac7 · rakudo#2783
  1. 1

    A bare use v6.e without .PREVIEW is refused with X::Language::ModRequired.

  2. 2

    A use v6.… naming a revision or modifier no compiler exists for is refused with X::Language::Unsupported.

will-never-work-compile-timeRaku++ passesRakudo passes2026-10-07 · d78d1cb0
  1. 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 try or a block.

    sub f(Str $x) { }; try f(42) runs nothing: Calling f(Int) will never work with declared signature (Str $x)

  2. 2

    A call with no arguments to a sub whose signature has a required named parameter is refused at compile time.

    needs() against sub needs(:$name!) does not compile

wordquote-colonpair-bracketRaku++ passesRakudo passes2026-11-08 · 5f6d78e4 · #231
  1. 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 passes2026-10-27 · 4af53b07
  1. 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).