Raku Cases › Exceptions & control flow

Exceptions & control flow

Failures, try and CATCH, control exceptions, return, next, last.

135 rules from 87 tests. 71 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.

readonly-errorsRaku++ matches Rakudo on 36 of 44 probes2026-11-28 · 04a1722e
  1. 1

    Every operator that assigns (=, +=, ++ …), applied to a value that is not a container, throws the immutability exception of the right type, such as X::Assignment::RO. inferred

start-returnRaku++ matches Rakudo on 43 of 75 probes2026-11-28 · 04a1722e
  1. 2

    A control exception with no routine or loop to catch it is an error, in every kind of block that can hold one. inferred

6e-gatingRaku++ passesRakudo cannot run it2026-08-19 · 387d2c88
  1. 25

    From 6.e next(value) and last(value) supply a value to the loop's result; before 6.e such a call is a compile-time error and nothing runs.

    under 6.e (1,2,3).map({ $_ == 2 ?? next(42) !! $_ }).List is (1 42 3) and with last(99) it is (1 99); under 6.d "Calling next(Int) will never work"

More from this test: Dates & times (2), Hashes & sets (3), I/O & processes (2), Lists & laziness (8), Numerics (1), Classes, roles & the MOP (2), Operators (1), Everything else (2), Regexes & grammars (2), Scoping & phasers (2), Signatures & dispatch (1), Strings & Unicode (6), divergences (1).

audited-language-gaps-1Raku++ passesRakudo passes2026-10-04 · 76f5426d
  1. 11

    The type object of a user Exception subclass cannot .throw.

More from this test: Concurrency (1), Containers & assignment (1), Hashes & sets (1), Lists & laziness (2), Operators (1), Regexes & grammars (2), Signatures & dispatch (3), Syntax & parsing (2).

backtrace-caughtRaku++ passesRakudo passes2026-09-04 · 397bbe81 · #67
  1. 1

    A caught exception's .backtrace records where the exception was thrown, not where .backtrace is called.

  2. 2

    .Str on a Backtrace renders frame lines.

  3. 3

    A backtrace begins with the setting's own throw and die frames, for which .is-setting is True, followed by the user code's frames.

backtrace-newRaku++ passesRakudo cannot run it2026-08-27 · 0cf03aa8
  1. 1

    Backtrace.new returns the current backtrace without anything being thrown.

  2. 2

    Backtrace frames made by the mainline of a module or of an EVALFILE'd file name that file.

backtrace-uncaughtRaku++ passesRakudo times out2026-09-04 · 397bbe81 · #67
  1. 1

    An uncaught exception prints its message on the first line, followed by backtrace frames of the form in <kind> <name> at FILE line N.

backtrace-warn-fail-awaitRaku++ passesRakudo cannot run it2026-09-04 · 0142f38d · #67
  1. 1

    warn prints its message together with the position it was called from.

  2. 2

    A Failure that is used reports where it was created by fail as well as where it was used.

  3. 3

    An exception rethrown by await reports the worker's frames where it was thrown, as well as the awaiting line.

base64-sextetRaku++ passesRakudo passes2026-07-23 · 820a2168
  1. 1

    In the statement form do with (EXPR) { $^a }, the block's placeholder parameter receives the topic.

More from this test: Lists & laziness (1), Regexes & grammars (1), Scoping & phasers (1), Signatures & dispatch (4).

binding-failure-priors-and-hintRaku++ passesRakudo passes2026-11-08 · 0cee5c8f
  1. 1

    The error for a Failure refused by a typed parameter opens with "Earlier failure:", the failure and its backtrace, then "Final error:" and the type check.

    "Earlier failure:\n boom\n" … "\nFinal error:\n "

  2. 2

    The binding error of an @ parameter given a Hash, a Map or a Pair, named or positional, goes on ". You have to pass an explicitly typed array, …"; an Int gets no such hint.

callables-method-rw-capture-requiredRaku++ passesRakudo passes2026-07-27 · 49bc60d6
  1. 5

    The assignment type-check message renders the offending value the same way the binding message does, quoted and elided.

More from this test: Classes, roles & the MOP (2), Signatures & dispatch (3).

cannot-map-message-suggestionRaku++ passesRakudo passes2026-11-08 · 1695a062
  1. 1

    The message of X::Cannot::Map ends with its suggestion on a line of its own.

    (1,2).map(5): "Cannot map a List using '5'\nDid a * (Whatever) get absorbed by a list?"

catch-before-leaveRaku++ passesRakudo passes2026-10-01 · 55b4f18a
  1. 1

    The CATCH that takes an error runs before the LEAVE phasers of the blocks between it and the die; those blocks are left (LEAVE, UNDO, temp and let restored) only once the handler is done.

  2. 2

    An outer CATCH sees the temp/let values and the $*x of the dying block still in place, and .resume gets back into the block that died.

More from this test: divergences (1).

catch-by-handRaku++ passesRakudo passes2026-09-27 · 9cc30857
  1. 1

    When a block's CATCH matches nothing, the block's LEAVE and UNDO phasers run exactly once and the enclosing block's temp values are still in place when an outer CATCH runs.

  2. 2

    next or return inside a CATCH block leaves the handler at once; the rest of the handler does not run.

catch-in-methodRaku++ passesRakudo passes2026-08-04 · 65f8c732
  1. 1

    A CATCH block inside a method handles exceptions thrown in that method, and when nothing is thrown it does not run and does not supply the method's return value.

conformance-phase2-introspectionRaku++ passesRakudo passes2026-07-25 · 5103b4d7
  1. 6

    A Failure's .handled is assignable.

  2. 7

    A bare fail with no argument carries an X::AdHoc, so .exception.message answers.

More from this test: Containers & assignment (1), Hashes & sets (1), I/O & processes (1), Classes, roles & the MOP (1), Scoping & phasers (1), Signatures & dispatch (2), Types & coercion (1).

control-handled-leaves-block-lax-package-var-str-warnsRaku++ passesRakudo passes2026-09-17 · 2e994990
  1. 1

    A CONTROL handler whose when or default matched a warning and did not .resume consumes the warning and leaves the block that declared the CONTROL, as a CATCH leaves its block.

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

control-warn-and-datetime-attrsRaku++ passesRakudo passes2026-08-12 · 3e238862
  1. 1

    warn raises a CX::Warn control exception that the innermost dynamically enclosing CONTROL block can intercept; a handler that calls .resume suppresses the default print, and one that does not leaves it standing.

    CONTROL { when CX::Warn { .resume } } silences a warn

  2. 2

    A CONTROL block does not catch a die, and a warn issued inside a CONTROL handler goes to the next outer handler.

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

dd-failure-not-sunk-and-exception-rakuRaku++ passesRakudo passes2026-11-13 · eb482a9f · rakudo#2434
  1. 1

    dd returns Nil, so a Failure it showed is not sunk and thrown after it.

    dd $x % 0e0 prints the Failure and does not then throw it

More from this test: Stringification (1).

die-exception-composed-role-firstRaku++ passesRakudo passes2026-11-02 · 42618157
  1. 1

    die of an object whose class names a role before is Exception throws that object itself, not an X::AdHoc wrapping it.

    with class D does Iterable is Exception, a CATCH after die D.new sees a D

dist-suite-quartetRaku++ passesRakudo passes2026-08-05 · 4e2c20cd
  1. 18

    Exception.throw records a backtrace whose frames answer .file and .line.

More from this test: Dates & times (1), I/O & processes (1), Classes, roles & the MOP (4), Operators (1), Everything else (1), Regexes & grammars (2), Scoping & phasers (1), Signatures & dispatch (2), Stringification (1), Syntax & parsing (3), Types & coercion (2).

divide-by-zero-failureRaku++ passesRakudo passes2026-07-28 · 4b8c8e24
  1. 2

    try sets $! when its block returns a Failure rather than throwing.

More from this test: Numerics (1), divergences (1).

do-quietly-in-placeRaku++ passesRakudo passes2026-10-16 · 205f5e97
  1. 2

    A die or a Failure passes through do { … } and quietly { … } untouched; only try runs its block under use fatal.

duration-slip-fail-destructureRaku++ passesRakudo cannot run it2026-10-22 · 3e97932e
  1. 6

    fail in a block that another routine runs returns the Failure from the routine the block was written in, as return does.

    in sub q { ap({ fail "z" }); … } the Failure is returned from q, not from ap

More from this test: Containers & assignment (1), Dates & times (2), Lists & laziness (2).

eco-blockers-2026-09-14Raku++ passesRakudo passes2026-09-14 · 3b6b50af
  1. 5

    A backtrace frame is a Backtrace::Frame, a type name a signature can use.

More from this test: I/O & processes (2), Operators (2), Signatures & dispatch (1), Stringification (1), Syntax & parsing (2).

empty-block-is-nilRaku++ passesRakudo passes2026-09-04 · 0272cd9a
  1. 1

    A block that produces no value evaluates to Nil: an empty sub or method, try {}, a taken but empty if, and an empty loop body collected by do for.

More from this test: Containers & assignment (1).

error-messages-rakudo-settledRaku++ passesRakudo passes2026-11-14 · 13902c52 · rakudo#1987 · rakudo#2595
  1. 1

    Assigning to a method's return value throws X::Assignment::RO whose message names the returned value, not the invocant. inferred

    (-5).abs += 1 dies with "Cannot modify an immutable Int (5)"

  2. 3

    A failed return-type check against a subset names the value it refused. inferred

    subset RT of Any where Int; sub f(--> RT) { 1.8 }; f() dies with "Type check failed for return value; expected RT but got Rat (1.8)"

More from this test: Hashes & sets (1), I/O & processes (1), divergences (1).

eval-loop-controlRaku++ passesRakudo passes2026-09-07 · 35c9691a
  1. 1

    Loop control (next, last, redo) inside an EVAL string controls the loop that encloses the EVAL.

    for ^3 { EVAL q[last] } ends the for

exception-gist-message-methodRaku++ passesRakudo passes2026-09-16 · fbed595e
  1. 1

    An Exception whose message is a method gists to that message.

    say $e prints the computed message, as say ~$e does

exception-hierarchyRaku++ passesRakudo passes2026-09-10 · 48b8b61b
  1. 1

    The X:: exception types form a class hierarchy with roles, so a subclass smartmatches its ancestors and CATCH { when X::TypeCheck {…} } catches its subclasses.

    X::TypeCheck::Binding::Parameter ~~ X::TypeCheck::Binding is True

  2. 2

    A type-check failure binding an argument to a signature parameter throws X::TypeCheck::Binding::Parameter, while a failed := to a typed variable throws plain X::TypeCheck::Binding.

exception-messages-and-mop-mutatorsRaku++ passesRakudo passes2026-07-27 · c0e8233a
  1. 1

    EVAL 'x', :lang<bar> throws a typed exception object, not a bare Str.

  2. 2

    X::NoDispatcher has its .redispatcher attribute set and its message reads "<redispatcher> is not in the dynamic scope of a dispatcher".

  3. 3

    X::Str::Match::x carries a got attribute and a proper message. inferred

  4. 4

    Type-check error messages render the offending value with .raku — a Str keeps its quotes, a List separates with commas, a Hash uses colon-pair form — and elide past 23 characters, keeping 20 plus ....

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

exception-new-messageRaku++ passesRakudo passes2026-11-13 · 251842c2 · rakudo#2434
  1. 1

    X::Method::NotFound and X::Numeric::DivideByZero made with .new have a defined .message.

exception-new-messagesRaku++ passesRakudo passes2026-11-08 · 0f3b9feb
  1. 1

    The message of an X::Str::Numeric made with .new is "Cannot convert string to number: <reason> in '<before><HERE><after>' (indicated by <HERE>)".

  2. 2

    The message of an X::OutOfRange made with .new writes its range by .gist.

    a range of 1..2 reads "should be in 1..2", not "1 2"

exe-condition-binder-valueRaku++ passesRakudo passes2026-11-11 · ce09fe50
  1. 2

    An if EXPR -> $x { … } else { … } that is a routine's last statement is the routine's return value.

    a routine ending in if self.elems -> \elems { "have {elems}" } with 3 elements answers "have 3"

exe-fail-in-routineRaku++ passesRakudo cannot run it2026-10-22 · d7c6d9d5
  1. 1

    fail inside a routine returns its Failure from that routine (or throws it under use fatal), and in the mainline, with no routine around it, fail is die.

    q(-1) // "failed" is "failed" when q fails

exe-mechanical-nativeRaku++ passesRakudo passes2026-11-20 · ef8f4453
  1. 2

    $! belongs to the routine: a try in a called sub does not rewrite its caller's $!.

  2. 9

    A block whose value is a variable's ({ $p }) hands that value back unsunk, so a Failure in it does not throw at the statement that calls the block.

More from this test: Containers & assignment (1), Classes, roles & the MOP (1), Scoping & phasers (1), Signatures & dispatch (3).

exe-outer-step-native-opsRaku++ passesRakudo passes2026-10-24 · 42f79e98
  1. 3

    A try whose block returns a live Failure answers Nil with $! set; with no fatal in the block the Failure is the value; and a Failure already handled passes through as the value with $! Nil.

  2. 4

    A Failure used as a subscript throws the exception it carries.

    @a[1 div 0] = 5 throws instead of storing into @a[2]

    Also held by failure-as-subscript.

  3. 6

    $failure.handled is assignable, to True and back to False.

    $failure.handled = True

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

exe-sinks-discarded-valuesRaku++ passesRakudo passes2026-10-04 · ddf56aba
  1. 2

    A value discarded at statement level is sunk: an unhandled Failure throws, and a lazy .map or a gather written as a statement runs its block.

    try { "abc".Int; … } leaves the block at the first statement

exe-try-fatalRaku++ passesRakudo passes2026-11-11 · d1203ef3
  1. 2

    A try block's implicit use fatal makes the call sites written inside the block throw a Failure they get back, except in a boolean or definedness context; it does not make a fail die inside the routines called.

    try { rgfail() // 'caught' } answers 'caught' when rgfail fails

  2. 3

    A Failure built as an argument inside a try, as in try f(Failure.new("x")), reaches the binder of the routine called instead of being thrown first.

  3. 4

    A fail written directly inside a try block dies.

fail-in-mainline-block-throwsRaku++ passesRakudo passes2026-11-08 · 8f0b138e
  1. 1

    A fail in a block written at the mainline, with no routine around it to return a Failure from, throws.

    sub ap(&b) { b() }; my $r = ap({ fail "x" }) throws rather than returning a Failure from ap

  2. 2

    A fail written in a routine returns its Failure from that routine, a block inside the routine included.

failure-as-subscriptRaku++ passesRakudo passes2026-10-24 · 85d56001
  1. 2

    A Failure also throws as a hash key, under :exists, as an element of a slice or junction subscript, and as the argument of the AT-POS and *-KEY methods of a built-in Array or Hash.

    %h{$f} = 5 throws for a Failure $f

failure-detonates-on-any-methodRaku++ passesRakudo passes2026-09-15 · e8c5dd0d
  1. 1

    Calling a method that Failure does not itself provide on an unhandled Failure throws the exception it carries.

    "x".Int.elems throws

failure-detonationRaku++ passesRakudo passes2026-08-15 · ad412e90
  1. 1

    An unhandled Failure throws when its value is used, in arithmetic or .Int as much as in stringification, and when it is sunk.

  2. 2

    Asking about a Failure does not throw: $f ~~ Failure, //, ||, orelse and the negated identity !=== all answer quietly.

  3. 3

    The first thing that touches a Failure marks it handled, so it answers differently the second time. inferred

failure-mess-and-backtraceRaku++ passesRakudo passes2026-11-08 · 1c32f010
  1. 1

    A Failure answers .backtrace, where it was made, and .mess, its message and that backtrace, without throwing.

  2. 2

    An exception never thrown has no backtrace: its .backtrace is Nil, a Failure's own exception too.

  3. 3

    A type check that refuses a Failure opens its message with the Failure's .mess, so a fail in a sub names that sub's frame.

for-as-block-value-is-not-sunkRaku++ passesRakudo passes2026-11-13 · 6fcd9181 · rakudo#1360
  1. 1

    A for loop that is its block's last statement, and so the block's value, does not sink its iterations.

    { Failure.new for ^5 }() returns Nil and throws nothing

  2. 2

    A for loop that is not its block's last statement sinks each iteration.

grand-review-c1-interpRaku++ passesRakudo passes2026-09-06 · fa74f74f
  1. 5

    A return in the mainline, outside any routine, is an error and the program exits non-zero.

    a program whose mainline runs return exits with code 1

  2. 9

    A method body sinks its non-final statements.

  3. 10

    A die inside the replacement block of s/// or inside a user-defined infix applied to objects propagates to the caller.

More from this test: Containers & assignment (1), I/O & processes (1), Numerics (7), Operators (4), Scoping & phasers (4), Signatures & dispatch (3), Stringification (1), Strings & Unicode (1).

hidden-from-backtrace-framesRaku++ passesRakudo passes2026-11-08 · fa865d47
  1. 1

    is hidden-from-backtrace hides the routine's frame from the printed backtrace, while the frame stays in .backtrace.list, with .is-hidden True, and in .full.

  2. 2

    A routine with is hidden-from-backtrace answers .is-hidden-from-backtrace True, and one without the trait has no such method.

More from this test: divergences (1).

interpolated-block-error-lineRaku++ passesRakudo passes2026-11-08 · e89a0e1e
  1. 1

    A runtime error in a {…} block of a multi-line string names the line the block is on, while an interpolated $x.nope() on a later line names the statement's line.

list-array-semantics-sheetRaku++ passesRakudo passes2026-09-19 · 1e36359f
  1. 20

    An unknown adverb on an array subscript throws X::Multi::NoMatch. inferred

    @a[0]:foo throws X::Multi::NoMatch

More from this test: Containers & assignment (7), Lists & laziness (11), Stringification (3), Types & coercion (2).

method-return-as-statementRaku++ passesRakudo passes2026-10-30 · d54cc3ba
  1. 1

    EXPR.return (Mu.return) returns the invocant from the routine it is written in, as return EXPR does.

    .return if .is-applicable($message) returns the topic from the enclosing routine

module-unblock-batchRaku++ passesRakudo passes2026-08-12 · 3d6f6abd
  1. 3

    An explicit CATCH in a try block replaces try's implicit swallow: an exception the handler itself throws, or one that no when/default matched, propagates past the try.

More from this test: Operators (1), Signatures & dispatch (1), Types & coercion (1).

multi-method-nomatch-signaturesRaku++ passesRakudo passes2026-11-09 · 07dd7b4a
  1. 1

    A multi method no candidate takes is refused with a line for each candidate's signature after "none of these signatures matches", a role's candidate naming the class that composed the role.

    A.new.m("x"): "Cannot resolve caller m(A:D: Str:D); none of these signatures matches" then (A $:: Int, *%_)

multi-nomatch-dispatcher-captureRaku++ passesRakudo passes2026-10-09 · 6acb4326
  1. 1

    X::Multi::NoMatch carries .dispatcher, the routine called, and .capture, the arguments as a Capture with the invocant first for a method.

More from this test: Operators (1).

native-smartmatch-and-whatever-valuesRaku++ passesRakudo passes2026-09-22 · 2d8e5481 · #96
  1. 8

    A block-final if or given inside do { … } gives the block its value.

    my $x = do { if 1 { 'y' } else { 'n' } } is 'y'

More from this test: Operators (5), Types & coercion (3).

needle-compile-clusterRaku++ passesRakudo passes2026-09-12 · cb851ea9
  1. 5

    Reading past the end of a Blob with nqp::readuint, .read-uint16, .read-num32 or .read-num64 throws an exception whose message starts MVMArray: read_buf out of bounds. inferred

    Blob.new(0xf9, 0).read-uint16(-1) dies with MVMArray: read_buf out of bounds offset -1 start 0 elems 2 count 2

More from this test: Classes, roles & the MOP (1), Everything else (1), Signatures & dispatch (2), Stringification (2).

needle-type-object-no-matchRaku++ passesRakudo passes2026-11-08 · c73d0b8d
  1. 2

    The capture an X::Multi::NoMatch message prints names the invocant's definedness and writes a Bool named argument as the adverb it was.

    m(A:D: Str:D); :i and :!i, not :i(Bool)

More from this test: Strings & Unicode (1).

nested-sub-backtrace-fileRaku++ passesRakudo cannot run it2026-09-11 · 03bd5a90
  1. 1

    A backtrace frame for a my sub declared inside a module's routine names the module's file together with the line in that file.

next-return-in-expression-cooperativeRaku++ passesRakudo passes2026-10-27 · 48b76d56 · #195
  1. 2

    A return as the left operand of or returns at once, so the right operand never runs.

    (return 5) or say 'x' returns 5 and prints nothing

nqp-exception-ops-and-whereRaku++ passesRakudo passes2026-10-31 · aa309270 · #77
  1. 1

    nqp::newexception, nqp::setmessage, nqp::setextype, nqp::setpayload and nqp::throw build and throw an exception by hand, and one typed nqp::const::CONTROL_WARN is caught in a CONTROL block and resumes with .resume.

More from this test: Everything else (1).

open-failure-is-loudRaku++ passesRakudo does not pass2026-09-07 · fd6eab64 · #71
  1. 2

    The exception of a failed open smartmatches X::AdHoc, and its .payload is the message.

More from this test: I/O & processes (3), divergences (1).

pdf-family-2026-09Raku++ passesRakudo passes2026-09-14 · a3586267
  1. 35

    The else branch of with/without aliases the tested value as its topic.

More from this test: Containers & assignment (8), I/O & processes (1), Lists & laziness (1), Modules (1), Numerics (1), Classes, roles & the MOP (14), Operators (1), Regexes & grammars (3), Scoping & phasers (4), Signatures & dispatch (9), Syntax & parsing (11), Types & coercion (3).

plain-object-any-list-methodsRaku++ passesRakudo passes2026-11-08 · 586a7f14
  1. 3

    .invert of something that is not a Pair dies "Type check failed in invert".

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

precomp-method-call-flagsRaku++ passesRakudo passes2026-10-30 · d4ed6cac · #60
  1. 2

    Under use fatal, so f() tests the Failure that f returns instead of throwing it. inferred

private-method-notfound-payloadRaku++ passesRakudo does not pass2026-08-30 · 71abc700
  1. 1

    Calling a missing private method throws X::Method::NotFound whose .method is the bare name, whose .private is true, and whose message begins No such private method.

    the message reads No such private method '!wrong'

More from this test: Compile-time errors (1).

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

    A statement label cannot shadow a pseudo-package: under a loop labelled OUTER (or MY, OUR, CORE, SETTING, UNIT, OUTERS, CALLER, CALLERS, DYNAMIC, LEXICAL, CLIENT), next OUTER, last OUTER and redo OUTER name the pseudo-package and die because no candidate takes it.

    OUTER: for 1..2 -> $i { for 1..2 -> $j { next OUTER if $j > $i; print "$i$j " } } prints 11 then dies Cannot resolve caller next(OUTER:U)

  2. 3

    A label named COMPILING, PROCESS, PARENT or like a type name is found as a label by next, last and redo.

  3. 4

    From language version 6.e, next OUTER under a loop labelled OUTER passes the package as the iteration's value instead of dying.

  4. 5

    next, last and redo act on the loop their argument labels in every spelling — next(FOO), next $label, last(FOO) — and a statement modifier after the argument (redo $l if …) still applies.

  5. 6

    next given a type object that is not a Label does not succeed: no candidate of next takes it. inferred

  6. 7

    A Label object has .next, .last and .redo methods.

More from this test: Compile-time errors (1).

rakudo-t-language-gaps-2Raku++ passesRakudo passes2026-10-05 · e209ae16
  1. 9

    no fatal inside a try block keeps a Failure a Failure.

  2. 16

    In 6.e, next and last take a value as payload. inferred

More from this test: Compile-time errors (1), Hashes & sets (1), Lists & laziness (2), Operators (2), Regexes & grammars (4), Scoping & phasers (1), Signatures & dispatch (1), Syntax & parsing (1).

rakuglaze-round-4Raku++ passesRakudo passes2026-10-03 · 99895bb5
  1. 1

    A try block is under use fatal.

    try fatalizes a Failure from a method call too

    Also held by rakudo-t-language-gaps-2.

  2. 2

    An EVAL inside a try block is not under the try's use fatal. inferred

  3. 4

    An EVAL'd unit's own CATCH handles an error that dies deeper down in it. inferred

  4. 6

    die with an object that is not an Exception throws X::AdHoc carrying that object. inferred

More from this test: Hashes & sets (2), Lists & laziness (1), Classes, roles & the MOP (1), Operators (1), Scoping & phasers (1), Signatures & dispatch (1), Types & coercion (2).

rakuglaze-round-6Raku++ passesRakudo passes2026-10-09 · 8902cac9
  1. 10

    Exception.fail makes the routine that calls it return a Failure wrapping the exception.

More from this test: Concurrency (1), Hashes & sets (2), I/O & processes (1), Lists & laziness (2), Classes, roles & the MOP (1), Regexes & grammars (1), Scoping & phasers (1), Syntax & parsing (2).

repl-echo-ruleRaku++ passesRakudo cannot run it2026-09-04 · 507d8edb · #66
  1. 1

    A loop statement evaluates to Nil, for instance as the last statement of a sub or of an EVAL, while a loop written as an expression (do for, (for …)) yields its values.

More from this test: Everything else (1).

return-from-when-in-loopRaku++ passesRakudo passes2026-10-03 · 3fa9dcaf
  1. 1

    return from inside a when inside a for leaves only its own routine, and the caller's following block runs every one of its statements.

roast-3log-batch1Raku++ passesRakudo passes2026-09-28 · ea9f1388
  1. 5

    A caught exception's backtrace lists the setting's throw/die frames and every bare block it passed through.

  2. 8

    A bare fail with no argument uses the routine's own $!.

More from this test: Dates & times (1), Hashes & sets (1), I/O & processes (3), Lists & laziness (2).

roast-3log-batch2Raku++ passesRakudo passes2026-09-28 · bda6f720
  1. 10

    return inside a routine-level when / default returns from that routine only, not from its caller too.

More from this test: Modules (1), Numerics (1), Classes, roles & the MOP (6), Everything else (1), Regexes & grammars (5), Scoping & phasers (1), Syntax & parsing (1).

roast-sweep-runtimeRaku++ passesRakudo cannot run it2026-09-28 · 2cc896bd
  1. 23

    .resume on a caught exception carries on at the statement after the one that died. inferred

  2. 55

    A routine whose body is the stub ... answers a Failure holding X::StubCode when called. inferred

More from this test: Compile-time errors (4), Concurrency (2), Containers & assignment (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).

routine-scoped-match-and-when-lastRaku++ passesRakudo passes2026-08-05 · 73e24219
  1. 2

    last inside a bare when inside a for ends only that loop and has no effect on a loop in the caller.

More from this test: I/O & processes (1), Classes, roles & the MOP (1), Regexes & grammars (1).

string-position-out-of-range-failureRaku++ passesRakudo passes2026-10-21 · f01c2ef2
  1. 1

    .index, .rindex, .indices, .contains and .substr-eq with a negative start position (or one past what an Int holds) return a Failure holding an X::OutOfRange whose what is "Position in calling 'index'" and whose range is a Str.

    "abc".index("a", -1) fails with "… out of range. Is: -1, should be in 0..3"

superscript-call-but-bool-redo-copy-and-friendsRaku++ passesRakudo passes2026-09-17 · 2e994990
  1. 3

    redo binds an is copy parameter afresh from the original argument.

More from this test: I/O & processes (1), Lists & laziness (1), Signatures & dispatch (2), Stringification (1), Syntax & parsing (1), Types & coercion (1).

temporal-out-of-rangeRaku++ passesRakudo passes2026-09-15 · 02003b9f
  1. 1

    A standard X:: exception built by hand renders its message from its attributes, so X::OutOfRange.new(what => …, got => …, range => …) has a defined .message and a non-empty .gist.

More from this test: Dates & times (1).

throw-from-small-framesRaku++ passesRakudo passes2026-11-06 · 9debac5c
  1. 2

    A die with no argument raises the current $! again.

top100-roots-2026-09-02Raku++ passesRakudo does not pass2026-09-02 · 7af75847
  1. 15

    A die inside a user trait_mod:<is> handler propagates to the code compiling the declaration that carries the trait.

  2. 16

    next used as an operand, as in my Str $s = %h{$_} // next, skips the rest of the iteration before the typed assignment happens.

More from this test: Containers & assignment (1), Lists & laziness (1), Modules (1), Native types & NativeCall (3), Numerics (1), Classes, roles & the MOP (4), Regexes & grammars (3), Scoping & phasers (1), Stringification (1), Strings & Unicode (2), Syntax & parsing (3), Types & coercion (6).

try-block-sink-and-trailing-catchRaku++ passesRakudo passes2026-10-28 · 642a320a
  1. 1

    try and quietly hand their block's value on in its container, as do does, and a value in a container is not sunk.

    try { $result = await $completion; CATCH { default { … } } } does not sink the Proc in $result

  2. 2

    A CATCH or CONTROL written last is the block's last statement: the statement before it runs in sink context inside the block, so what sinking throws goes to that CATCH, and the block answers Nil.

    try { await $completion; CATCH { default { } } } catches the X::Proc::Unsuccessful of the sunk Proc

try-statement-is-a-block-frameRaku++ passesRakudo passes2026-11-13 · ecaee71c
  1. 1

    The statement form try EXPR is a frame of its own in the backtrace, as try { … } is.

  2. 2

    An in-place try, do or quietly block is in .backtrace.list but not in the printed backtrace.

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

typecheck-exception-built-by-handRaku++ passesRakudo passes2026-10-31 · 52426690 · #77
  1. 1

    An X::TypeCheck exception built with .new renders its .message from its attributes, as one that was thrown does.

    X::TypeCheck::Assignment.new(symbol => '$x', got => 42, expected => Str).message is defined

typed-exception-payloadsRaku++ passesRakudo does not pass2026-07-28 · 36a73443
  1. 1

    An error raised by the runtime reaches $! as an object of its exception class, so $!.^name names the class and $!.message answers.

    after try { nosuchsub(1) }, $!.message works and $!.^name is not Str

  2. 3

    die with a user-supplied payload keeps that payload as given. inferred

uninit-warning-names-and-placeRaku++ passesRakudo cannot run it2026-10-02 · 925260b1
  1. 1

    The "Use of uninitialized value" warning names the variable or element the value was read from and ends with the routine and line, as warn does.

    it names $u, @a[2], %h{'k'}, or element for an operand of ~

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

when-condition-whatever-curryRaku++ passesRakudo passes2026-09-22 · 2d8e5481 · #96
  1. 1

    A when condition containing * is curried once into a WhateverCode and called with the topic, so the arm is taken only when it answers true.

    given $d { when * < 1 {…} when * >= 1 {…} } takes the arm the topic satisfies; *.chars == 3 and !(* < 1) work as conditions

zef-install-clusterRaku++ passesRakudo passes2026-07-25 · da1b9b3d
  1. 1

    A given block whose when clauses all miss evaluates to False, the smartmatch result of the last when, not Any.

  2. 3

    A labeled loop may directly follow gather, as in gather LABEL: for … { next LABEL }.

  3. 5

    next() and last() written with parentheses are the control operators themselves and compose inside expressions, as in next() R, DEBUG(...) if COND.

More from this test: Containers & assignment (1), Modules (1), Types & coercion (1).