Raku Cases › Types & coercion

Types & coercion

Type objects, definedness, smileys, subsets, enums, and what converts to what.

180 rules from 126 tests. 106 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.

coercer-callsRaku++ matches Rakudo on 1 of 13 probes2026-11-28 · 04a1722e · #276
  1. 3

    Type(args) is a coercer call for every type and with any number of arguments.

cool-methods-by-kindRaku++ matches Rakudo on 38 of 40 probes2026-11-28 · 2db47ea5
  1. 1

    The methods Cool gives a string or a number answer only for a value that is Cool: a Pair, a Set, a Version, a Regex, a Block or a Date has none of them.

  2. 2

    succ and pred exist only on the types that count.

lowercase-typesRaku++ matches Rakudo on 18 of 47 probes2026-11-28 · 04a1722e · #280
  1. 2

    A user type is a type whatever its first letter, in every declarator and on every assignment.

shadow-lexsubRaku++ matches Rakudo on 25 of 38 probes2026-11-28 · 04a1722e
  1. 1

    A type name followed by ( is a coercion even when a sub of the same name is declared: sub Int($x) does not capture Int(42).

    with sub Int($x) declared, Int(42) is still the coercion

    Also held by bound-type-names.

shadow-subsetRaku++ matches Rakudo on 37 of 38 probes2026-11-28 · 04a1722e
  1. 1

    subset Int of Cool … makes the name Int a subset where the declaration is in scope.

allomorph-numeric-sheds-the-strRaku++ passesRakudo passes2026-09-07 · 86710510
  1. 1

    .Numeric and .Real on an allomorph return the plain number, without the allomorph's string side.

    ~ <0o755>.Numeric is 493

More from this test: divergences (1).

allomorph-str-methodsRaku++ passesRakudo passes2026-10-29 · 62a3d9a5 · #212
  1. 1

    An allomorph is a Str and takes Str methods.

    <42>.parse-base(16) is 66

More from this test: Regexes & grammars (1).

audited-language-gaps-2Raku++ passesRakudo passes2026-10-04 · 39c1aeb6
  1. 3

    The value of an enum declaration used as an expression, my $e = enum Ea <a b>, is the enum's Map, as for an anonymous enum.

More from this test: Compile-time errors (2), Containers & assignment (1), Dates & times (1), Lists & laziness (3), Operators (1), Regexes & grammars (2), Strings & Unicode (2).

batch11b-typed-blobsRaku++ passesRakudo passes2026-07-23 · 9baeff7c
  1. 1

    A blob32 holds 32-bit elements: .elems counts elements, a subscript reads a whole element, and its numeric value is the element count. inferred

    blob32.new(0x11223344, 5).elems is 2

  2. 2

    A typed blob assigns its elements into a native-int array (my uint32 @W = $b), and @$b lists its elements. inferred

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

blob-not-str-and-position-edgesRaku++ passesRakudo passes2026-10-21 · 5e474d7d
  1. 1

    A Blob has no Str methods: .uc, .lc, .flip, .ord, .substr, .trim, .contains, .lines and the like die on it, and so do the sub forms such as uc($buf).

    Buf.new(1).uc dies with no such method

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

blob-numeric-and-zip-metaopRaku++ passesRakudo passes2026-07-29 · 8c793652
  1. 1

    A Blob in numeric context is its element count. inferred

  2. 2

    Blob ~ Blob is a Buf of the concatenated bytes, not a Str, and the bytes are never normalized. inferred

More from this test: Hashes & sets (1), Lists & laziness (1), Operators (1).

blob-param-costs-nothingRaku++ passesRakudo passes2026-10-29 · 55565059 · #177
  1. 3

    subbuf-rw refuses a Blob.

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

bson-simple-and-hash-agnosticRaku++ passesRakudo passes2026-08-31 · 2d04edb3
  1. 15

    A coercion call Leaf($x) written inside a package resolves the class name relative to that package.

More from this test: Containers & assignment (4), Dates & times (1), Hashes & sets (1), Modules (1), Classes, roles & the MOP (2), Operators (1), Signatures & dispatch (2), Stringification (1), Strings & Unicode (1).

bson-simple-codecRaku++ not runRakudo does not pass2026-08-31 · 34eed1b2
  1. 1

    A DateTime is not Associative: DateTime ~~ Associative is False.

    DateTime ~~ Associative is False

    Also held by istype-dateish-role.

buf-param-refuses-blobRaku++ passesRakudo passes2026-11-08 · 79b70d34
  1. 1

    A Buf parameter refuses a Blob, and a Hash parameter or variable refuses a Map, while a Buf passes for a Blob and a Hash for a Map.

    sub a(Buf $x) refuses Blob.new(1) and my Hash $h = Map.new is refused

  2. 2

    .Buf and .Blob coerce any buffer, a utf8 included.

    "xy".encode.Buf is Buf.new(120,121)

buf-signed-element-typeRaku++ passesRakudo passes2026-09-16 · 33a1b02f
  1. 1

    A Buf[int8] keeps its signed element type and reads its elements back signed.

    Buf[int8].new(255)[0] is -1

cbor-and-nqp-buffer-opsRaku++ passesRakudo does not pass2026-07-24 · 21e46c1a
  1. 2

    A buffer write method can be called on a temporary invocant, as in buf8.new.write-num64(...).

  2. 4

    Bool is an Int-backed enum, so True ~~ Int is True.

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

code-accepts-and-regex-callableRaku++ passesRakudo passes2026-09-11 · 6d82fac4
  1. 2

    A Regex is a Method, hence a Routine, Block, Code and Callable, and binds to a Callable:D parameter.

  2. 3

    .ACCEPTS on a built-in type object is a type check of its argument.

    Pair.ACCEPTS($x)

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

coerce-boxed-builtin-subclassRaku++ passesRakudo passes2026-10-09 · e59bae38
  1. 1

    Coercing to a class that derives a boxed built-in (class Sym is Str, likewise Int, Num or Rat) goes through T.new(x) on every route: the literal call Sym('b'), a type held in a variable, a Sym() parameter, a role's T($v) and the short name of the class inside its own package.

    Sym('b') with class Sym is Str gives a Sym

coercion-type-converts-on-assignmentRaku++ passesRakudo passes2026-09-15 · 148f566b
  1. 1

    A variable declared with a coercion type converts what it is assigned on every assignment, not only in its initializer.

    my Int() $x; $x = "7" converts instead of throwing, as my Int() $x = "7" does

coercion-typed-containerRaku++ passesRakudo passes2026-09-16 · fbed595e
  1. 1

    A coercion type as an array's or hash's element type coerces each element on assignment, not the right-hand side as a whole.

    my Int() @b = "3", "4" coerces each string; my Str() %s = a => 42 stores a Str

  2. 2

    A Map is not a Hash, so a Hash() coercion type converts a Map into a mutable Hash.

    my Hash() %options = %defaults over a Map of Maps stores Hashes

coercion-typed-element-storesRaku++ passesRakudo passes2026-10-11 · b21ea7a6
  1. 1

    A coercion-typed container such as my Hash() %h (a Hash[Hash(Any)], as .of shows) coerces every store into an element — %h<k> = …, a slice, ++, and push/append/unshift/prepend — not only its initializer.

More from this test: Hashes & sets (2).

complex-words-order-and-allomorph-newRaku++ passesRakudo passes2026-10-23 · 72e0c5fb
  1. 3

    IntStr.new, RatStr.new, NumStr.new and ComplexStr.new type-check their arguments as (Int:D $i, Str:D $s) and the like.

    IntStr.new("x", "y") dies binding Int:D $i

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

compound-assign-typecheckRaku++ passesRakudo passes2026-09-29 · a7e6e56d
  1. 2

    A compound assignment to a variable with a coercion type converts the result.

    my Int() $c = 1; $c /= 2 holds 0

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

conformance-list-adverbsRaku++ passesRakudo passes2026-07-26 · a1d04a23
  1. 8

    A Rat parameter rejects an Int (3 ~~ Rat is False), so duckmap -> Rat $_ {…} descends past Ints.

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

conformance-missing-routinesRaku++ passesRakudo passes2026-07-26 · 38c08132
  1. 1

    Junction.new(kind, elems) is the constructor spelling of any(), all() and one().

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

conformance-phase1-reprRaku++ passesRakudo passes2026-07-25 · 970de58d
  1. 6

    blob8 is Blob[uint8], and a blob's hex rendering groups digits by element, big-endian.

More from this test: Hashes & sets (1), Lists & laziness (2), Signatures & dispatch (1), Stringification (2).

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

    A Str coerces to Date, DateTime and Version with .Date, .DateTime and .Version. inferred

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

data-generators-clusterRaku++ passesRakudo passes2026-08-21 · 31b0a7ad
  1. 4

    A Range does Positional.

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

definiteness-types-and-runtime-classesRaku++ passesRakudo passes2026-07-26 · d4912f15
  1. 1

    Foo:D and Foo:U are types in term position: .^name reports the smiley, smartmatch tests definedness along with the type, and .^base_type strips it off.

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

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

    IO::Path is Cool and does IO but is not Stringy.

  2. 20

    An enum value is callable like its type.

    WARNING(TRACE) is TRACE

More from this test: Dates & times (1), Exceptions & control flow (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).

divergence-result-typesRaku++ passesRakudo passes2026-07-25 · e05a8563
  1. 2

    .^name on a junction answers Junction for the junction itself without autothreading, while ordinary methods such as .succ and .Str autothread. inferred

    (1 & 2).^name is Junction; (1 & 2).succ gists all(2, 3)

More from this test: Lists & laziness (3), Numerics (3), Operators (2).

doc-missing-methodsRaku++ passesRakudo cannot run it2026-07-28 · ccc187ec
  1. 1

    Buf.splice mutates the buffer in place and returns the removed bytes.

    Buf.new(1,1,2,3,5).splice(0, 3, <3 2 1>) gists Buf:0x<01 01 02> and leaves Buf.new(3,2,1,3,5)

  2. 4

    Blob.unpack decodes by template (C* every byte, A3 a counted string, n big-endian 16-bit), returning the bare value for a single result and a List for several. inferred

    Blob.new(1, 2, 3, 4).unpack("n*") gists (258 772)

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

ecosweep-2026-09Raku++ passesRakudo passes2026-09-05 · ebe0953e
  1. 6

    A subset may have a coercion type as its base: subset CC of Str() where ….

More from this test: I/O & processes (2), Modules (3), Classes, roles & the MOP (1), Operators (1), Scoping & phasers (2), Signatures & dispatch (1).

ecosweep-batch-fiveRaku++ passesRakudo passes2026-08-25 · 6879a71b
  1. 2

    $*USER and $*GROUP are IntStr allomorphs.

    $*USER.^name is IntStr

  2. 13

    Mu ~~ Any is False and Any ~~ Mu is True.

    (Mu ~~ Any) === False

More from this test: Hashes & sets (1), Native types & NativeCall (2), Classes, roles & the MOP (2), Operators (1), Regexes & grammars (1), Scoping & phasers (2), Signatures & dispatch (4), Syntax & parsing (1).

enum-numifyRaku++ passesRakudo passes2026-07-28 · ccc187ec
  1. 1

    An enum value numifies to a plain Int: .Numeric and prefix + give the underlying integer, as .Int and .value do.

enum-package-qualified-typeRaku++ passesRakudo passes2026-10-03 · 3fa9dcaf
  1. 1

    An enum declared in a package is a type by its qualified name, and a container typed with that name accepts the enum's values.

    has Cro::WebSocket::Message::Opcode $.opcode accepts Opcode::Text from package Cro::WebSocket::Message { enum Opcode … }

enum-type-called-from-a-containerRaku++ passesRakudo passes2026-10-29 · f3fb83e3 · #216
  1. 1

    An enum's type object held in a variable, an Array element or a Hash value coerces when invoked, as its name does.

    $r<x>(2) and $t(2) are CCC, as MyEnum(2) is

  2. 2

    A Scalar holding an enum's type object still holds a type object: it prints as one, smartmatches Int, has the enum's .^mro and can initialize a my Int variable.

    $t ~~ Int is True and my Int $i = $t works

enum-type-object-is-one-itemRaku++ passesRakudo passes2026-10-29 · 5e611fa3 · #216
  1. 1

    An enum's type object is one undefined item, not the list of its pairs: in a list, interpolated, counted, assigned to an array, iterated, in boolean and in numeric context.

    (MyEnum, 1) gists as ((MyEnum) 1), "{MyEnum}" is "", .elems is 1 and my @a = MyEnum takes one element

  2. 3

    Enumeration's own methods on the enum type (.keys, .pairs, .pick) read the enum's members.

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

exe-allomorph-literal-nativeRaku++ passesRakudo passes2026-11-19 · 81d08790
  1. 2

    <42>, <1.5>, <2e3> and the numeric words of < … > are allomorphs typed IntStr, RatStr, NumStr or ComplexStr, whose string is the source's spelling.

More from this test: Numerics (1).

exe-attribute-traitsRaku++ passesRakudo passes2026-11-11 · b991c157
  1. 2

    A slot with a coercion type in a my (…) declaration list coerces the value assigned to it.

    my ($a, Int() $b) = … coerces the second value to Int

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

exe-pair-key-and-adverbsRaku++ passesRakudo passes2026-11-11 · cf7816b6
  1. 4

    A Whatever held in a variable stays a Whatever when used as a Pair's key.

    my $w = *; ($w => 1).raku is * => 1

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

exe-typed-store-checkedRaku++ passesRakudo cannot run it2026-11-03 · 6617859d
  1. 1

    op= and ++ on a typed scalar check the stored value against the variable's type as = does.

    my Small $x = 5; $x += 100 dies

exe-value-semanticsRaku++ passesRakudo passes2026-11-11 · 090426b0
  1. 2

    A bare block { 1 } is a Block, not a Sub.

    { 1 }.^name is Block

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

exe-where-var-checkedRaku++ passesRakudo cannot run it2026-11-03 · d23c2ed8
  1. 1

    A variable's where constraint is checked on every store, op= and ++ included, for an untyped variable and inside a routine or inline block too.

    my Int $x where * < 10 = 5; $x += 100 dies

exported-nested-class-coercionRaku++ passesRakudo passes2026-10-07 · f888a02b · #90
  1. 1

    A coercion type spelled by the short name an import gave a class finds the class and calls its COERCE, for a class exported from a unit class or a unit module.

    with class N-Error is export inside unit class Gnome::Glib::T-error, an importer's my N-Error() $ne = $error calls COERCE

forward-types-and-statement-endRaku++ passesRakudo passes2026-08-20 · c3ba0e42
  1. 3

    A value that already is of a coercion type's target type is not coerced.

    Cool() $c given a Str keeps the Str; Int() $x given True keeps the Bool

    Also held by only-ellipsis-bracketed-infix.

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

getopt-long-parameter-traitsRaku++ passesRakudo passes2026-08-30 · 5e23726e
  1. 5

    The type of a coercion-typed parameter Foo(Str) :$foo is a coercion type: its name is Foo(Str), its HOW is a Metamodel::CoercionHOW, and .^constraint_type, .^target_type and .^coerce answer.

    .^constraint_type is Str and .^target_type is Foo

More from this test: Containers & assignment (1), Lists & laziness (1), Classes, roles & the MOP (2), Signatures & dispatch (2), Stringification (1), divergences (1).

grand-review-c4a-typesRaku++ passesRakudo passes2026-09-06 · fa74f74f
  1. 1

    Bool is an Int: .isa(Int), .does(Int) and ~~ Int all hold and Int is in Bool.^mro.

    Bool.^mro is Bool, Int, Cool, Any, Mu

  2. 2

    Str does the Stringy role: .does(Stringy) and ~~ Stringy are True, while .isa(Stringy) is False and the role is not in Str.^mro.

    Str.^mro is Str, Cool, Any, Mu

  3. 3

    An allomorph is both its numeric type and a Str for ~~, .isa and .^mro.

    <5>.isa(Str) is True; IntStr.^mro is IntStr, Allomorph, Str, Int, Cool, Any, Mu

  4. 4

    Real is a role, so 5.isa(Real) is False while 5 ~~ Real is True, and FatRat is not a Rat.

    FatRat ~~ Rat is False

hash-map-pair-semantics-sheetRaku++ passesRakudo passes2026-09-20 · ed688ad6
  1. 23

    A Pair is a value type only while its value is one: its .WHICH is then a ValueObjAt, two equal such Pairs are ===, and .unique follows that. inferred

    (a => 1) === (a => 1) is True; (a => [1]) === (a => [1]) is False

More from this test: Containers & assignment (3), Hashes & sets (13), Operators (4), Stringification (5).

http-simple-clusterRaku++ passesRakudo passes2026-08-02 · 2f4479d5
  1. 2

    Buf.new and Blob.new given a sole Blob argument copy its bytes, while a Blob among plain byte arguments is a type error.

    Buf.new(Buf.new(1, 2, 3)).list is (1, 2, 3); Buf.new($src, 4) dies

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

interp-meta-mixin-block-sig-allomorphRaku++ passesRakudo passes2026-07-27 · e143336a
  1. 5

    An allomorph is identical to neither of its halves for ===, eqv and quanthash membership.

    42 ∈ <42 55 1> is False

More from this test: Lists & laziness (1), Classes, roles & the MOP (1), Regexes & grammars (1), Signatures & dispatch (1), Strings & Unicode (1), divergences (1).

iospec-parts-and-numeric-identityRaku++ passesRakudo passes2026-07-27 · 5ee18c68
  1. 7

    A Range's .WHICH contains its gist, exclusion markers included.

More from this test: I/O & processes (4), Lists & laziness (1), Numerics (1), Strings & Unicode (1).

iospec-versioning-enums-filetestRaku++ passesRakudo passes2026-07-27 · 20fa90d5
  1. 5

    .enums called on an enum value answers the same as on its enum type.

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

issue-110-constructor-typecheckRaku++ passesRakudo passes2026-09-28 · c2161341 · #110
  1. 2

    A coercion-typed attribute coerces the value the constructor is given.

    has Date() $.d given a Str holds a Date

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

issue-116-module-type-short-namesRaku++ passesRakudo passes2026-10-02 · 76f2a994 · #116
  1. 2

    Cursor is the setting's old name for Match, so a Cursor-typed container accepts a Match.

    has Cursor $.cursor accepts a Match

More from this test: Modules (1), Regexes & grammars (1).

issue-222-parameterized-role-arguments-smartmatchRaku++ passesRakudo passes2026-11-07 · 28824bb7 · #222
  1. 1

    Two parameterizations of one role smartmatch when each argument on the right accepts the one on the left.

    Positional[Int] ~~ Positional[Mu] is True

    Also held by type-argument-smiley-name.

  2. 2

    Two parameterizations of one class smartmatch only when their arguments are identical.

    Array[Int] !~~ Array[Numeric]

  3. 3

    In a smartmatch of two role parameterizations, a :D argument on the right takes only itself, and a :U or bare one asks the nominal type.

    Positional[Int:D] !~~ Positional[Numeric:D]

issue276-builtin-coercer-callsRaku++ passesRakudo passes2026-11-21 · 9bcdc9e1 · #276
  1. 1

    Type(args) on a built-in type that values have no coercion method for (Duration, Blob, Buf, buf8, Range, IO::Path) is a coercer call that builds the type from the value, and a value already of the type is itself.

    Duration(120) builds a Duration from the value's Real, and Blob(1, 2) a Blob from its elements

    Also held by coercer-calls.

  2. 2

    A coercer call also works through a coercion-typed parameter (Duration()) and through a type held in a variable.

    Also held by coercer-calls.

  3. 3

    A coercer call on a parameterized Blob keeps the element width.

    Blob[uint16](1, 2) keeps both elements at 16 bits

issue35-zef-after-installRaku++ passesRakudo cannot run it2026-10-07 · 808e24eb · #35
  1. 3

    Assigning to a coercion-typed is rw attribute (has Str() $.uri is rw) coerces the value, as .new does.

    $c.uri = $path.IO is accepted and coerced

More from this test: Containers & assignment (1), Hashes & sets (1), I/O & processes (1), Lists & laziness (1), Modules (1).

issue37-fez-zef-installRaku++ passesRakudo cannot run it2026-08-27 · c63eb77a · #37
  1. 6

    Invoking an undefined Any value is the Any coercion, an identity, not a "Cannot invoke non-Callable" error.

More from this test: Containers & assignment (1), Modules (3), Regexes & grammars (1), Syntax & parsing (2).

issue91-atomicint-is-a-native-intRaku++ passesRakudo passes2026-09-21 · 87622e72 · #91
  1. 1

    atomicint is a native integer type everywhere, differing from int only in allowing the ⚛ operators: it binds an atomicint parameter, matches Int, and serves as a native array element type.

    my atomicint $n = 0; sub f(atomicint $x) {…}; f($n) binds; atomicint ~~ Int is True

istype-dateish-roleRaku++ passesRakudo passes2026-09-01 · b1bd5418
  1. 1

    nqp::istype($dt, Dateish) is true for a Date or DateTime, agreeing with $dt ~~ Dateish.

js-backend-framework-clusterRaku++ passesRakudo passes2026-09-13 · 862e3888
  1. 7

    A type with a :D smiley on the right of ~~ is False for the type object itself. inferred

    Tag ~~ Tag:D is False

More from this test: Operators (1), Scoping & phasers (2), Signatures & dispatch (1), Strings & Unicode (1), Syntax & parsing (2).

json-fast-clusterRaku++ passesRakudo does not pass2026-08-05 · ddc75ad1
  1. 1

    An enum value does Enumeration and smartmatches its own enum type.

    Squee ~~ Enumeration is True; 5 ~~ Enumeration is False

  2. 2

    An enum declared from pairs keeps each pair's value.

    enum Blerp (One => "Eins", Two => "Zwei"); One.value is Eins

  3. 3

    An enum type object is undefined, so with does not fire on it.

    Bloop.defined is False

  4. 4

    An enum's stash holds its values, Bool:: included.

    Bool::.values.sort is (False, True)

  5. 6

    nqp::istype recognises a role that an object does, and a Failure as Failure.

    nqp::istype(TC.new, Associative) is true for class TC does Positional does Associative

  6. 7

    .Rat on a RatStr is a plain Rat and .Int on an IntStr is a plain Int.

    RatStr.new(0.5, "x").Rat.^name is Rat

More from this test: Containers & assignment (1), Numerics (1), Operators (1), Signatures & dispatch (1), Strings & Unicode (1).

kernel-bool-variablesRaku++ passesRakudo passes2026-10-21 · a8c61b84
  1. 2

    A Bool is the Int it numifies to in arithmetic, the numeric comparisons and +=, and "True" or "False" as text.

lexical-type-aliasRaku++ passesRakudo passes2026-10-07 · 7546a2b3
  1. 1

    A type name on a variable, a parameter or a multi candidate means what it means in the scope that wrote it, so a lexical alias — an import from sub EXPORT or my constant Bar = Foo — is not lost to an unrelated class Bar elsewhere in the program.

    with Bar aliased to Foo, my Bar $v = Bar.new passes its type check

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

    Array[Int].new type-checks its elements and throws X::TypeCheck::Assignment for a wrong one. inferred

    Array[Int].new("a") throws X::TypeCheck::Assignment

  2. 21

    An Array identifies by object (.WHICH is an ObjAt) and an Int by value (ValueObjAt). inferred

    [1, 2].WHICH.^name is ObjAt

More from this test: Containers & assignment (7), Exceptions & control flow (1), Lists & laziness (11), Stringification (3).

listop-angle-words-unicodeRaku++ passesRakudo passes2026-09-29 · ee853a03
  1. 2

    A numeric angle word takes U+2212 as a minus anywhere a sign can stand, and the allomorph keeps the spelling as written.

    <5−1i> and <1e−5> are numeric allomorphs

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

lizmat-nqp-opsRaku++ passesRakudo passes2026-09-13 · 3a8f2148
  1. 3

    nqp::box_i($n, SomeType) boxes the integer as an instance of the type given as its second argument.

More from this test: Lists & laziness (1), Numerics (1), Operators (1), Everything else (1).

lowercase-type-in-myRaku++ passesRakudo passes2026-11-25 · b084275a · #280
  1. 1

    A user type whose name starts with a lowercase letter is a type in a declaration: my foo_t $x starts as (foo_t), is type-checked, and my foo_t $x .= new constructs a foo_t.

    my cairo_matrix_t $matrix .= new constructs a cairo_matrix_t

    Also held by lowercase-types.

math-nintegrate-fixesRaku++ passesRakudo passes2026-09-29 · e7be1d17
  1. 4

    An angle word that spells Inf (with or without a sign) or NaN is a NumStr, and a leading U+2212 is a minus sign.

    <x -Inf Inf> holds NumStrs for -Inf and Inf

More from this test: Regexes & grammars (1), Signatures & dispatch (3), Syntax & parsing (1).

modinfo-ecosystem-clusterRaku++ passesRakudo passes2026-08-02 · 2d99420e
  1. 3

    ::?CLASS with a smiley is usable as the declared type of a variable.

    method blank { my ::?CLASS:U $c = self.WHAT; $c } returns the class

More from this test: Hashes & sets (1), I/O & processes (1), Lists & laziness (1), Operators (1), Regexes & grammars (3), Scoping & phasers (2), Signatures & dispatch (3), Syntax & parsing (7).

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

    Calling a type object as T(x) on a class with no CALL-ME runs the coercion chain: the argument's own .T method if it has one, then T.COERCE(x), then T.new(x).

    Locale::Dates("EN") ends in Locale::Dates.new("EN")

More from this test: Exceptions & control flow (1), Operators (1), Signatures & dispatch (1).

named-subsig-pair-and-nested-coercion-smileyRaku++ passesRakudo passes2026-10-30 · 0938078e
  1. 2

    Hash:D(List:D(Pair:D)) is a nested coercion type: a smiley may sit between a type name and the ( of its coercion source.

More from this test: Signatures & dispatch (1).

native-return-type-checkedRaku++ passesRakudo does not pass2026-11-08 · 393aa64e
  1. 1

    A native return type unboxes what comes back, as a native parameter binds it, and refuses a value that cannot unbox.

    sub rn(--> num) { "s" } dies "This type cannot unbox to a native number: P6opaque, Str"

  2. 2

    --> num takes a Num or a NumStr, --> int an Int (a Bool is 1) and --> str a Str or an allomorph; a type object cannot unbox, and Nil passes as through any return type.

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

    A lone * is a Whatever value, not a closure.

    after my $w = *, $w ~~ Whatever is True

  2. 4

    A curried * expression held in a variable is a WhateverCode, so *-1 in a variable subscripts from the end and its .WHAT is (WhateverCode), not (Sub).

  3. 9

    A type with a definedness smiley in term position keeps the smiley in its name.

    Any:D.^name is not "Any"

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

nominal-type-checksRaku++ passesRakudo passes2026-10-07 · b2678f14 · #110
  1. 1

    An instance of a plain user class is not Cool, and neither is a Pair, a Set, a Sub, a Blob, an ObjAt, a Date, a Promise, an Exception or the Any type object.

    A.new ~~ Cool is False

  2. 4

    The value .WHICH returns binds an ObjAt parameter and does not bind Str or Stringy. inferred

  3. 6

    A typed $ variable or attribute checks any nominal type on assignment, so my Array $x = (1, 2), my Any $y = Mu, my Any $z = 1|2 and has Any $.a given Mu all die with a type check.

    my Any $x = Mu dies

More from this test: Signatures & dispatch (3).

non-ascii-names-bind-and-typeRaku++ passesRakudo passes2026-10-20 · edf09560
  1. 2

    A type whose name starts with a non-ASCII letter types a variable like any other: my Еоо $x has the (Еоо) default, takes .= new, type-checks assignment, and my Еоо @a has that .of.

    class Еоо { }; my Еоо $foo; say $foo does not print (Any)

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

nqp-iterator-buffer-and-bindattrRaku++ passesRakudo passes2026-09-11 · 6d82fac4
  1. 3

    A native str array accepts a Str that has a role mixed in.

    a "bar" but Type<words> value can be stored in a str array

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

nqp-scope-and-listRaku++ passesRakudo passes2026-07-23 · 87342334
  1. 1

    An Array is not a Seq, while the lazy result of .map is one.

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

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

    Assigning a negative number to a UInt variable fails the type check.

    my UInt $x = -42 is refused

  2. 4

    Int.new given a type object is refused, since a type object has no value to convert.

    Int.new(Int) is not 0

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

optional-subset-param-defaultRaku++ passesRakudo passes2026-11-08 · 7c69a48c
  1. 2

    A subset type smartmatches itself.

    CN ~~ CN is True

More from this test: Signatures & dispatch (1).

pair-and-list-are-immutableRaku++ passesRakudo passes2026-09-08 · 1497afb9 · #69
  1. 3

    A Pair is Associative.

    (a => 1) ~~ Associative is True

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

parameterized-decl-bind-posRaku++ passesRakudo passes2026-08-30 · 38a0d900 · #47
  1. 1

    A parameterized type in declarator position (my Pair[Int] $x) names the same type that the expression Pair[Int] evaluates to.

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

parameterized-type-smartmatchRaku++ passesRakudo does not pass2026-09-15 · d38fd73e · #89
  1. 1

    A parameterized type is smartmatched by its parameter as well as its base type.

    Array[Int] ~~ Array[Str] and Hash[Int] ~~ Hash[Str] are False

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

    A native array is an array, and is neither an Array nor a List.

  2. 41

    An instance of a class declared class T is Str { has $.value } is the string it was built with.

  3. 52

    A type parameter may name a constant that holds a type.

    constant W = uint32; Buf[W]

More from this test: Containers & assignment (8), Exceptions & control flow (1), 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).

quanthash-not-mapRaku++ passesRakudo passes2026-10-19 · 9550aecc
  1. 2

    $*RAKU, a Lock::Async, a CompUnit::DependencySpecification, a wrap handle, a CompUnit and an IO::Pipe do not smartmatch Associative.

  2. 3

    An IO::Path::Parts is Associative but is not a Map.

More from this test: Hashes & sets (1).

rak-chain-install-gapsRaku++ passesRakudo passes2026-10-10 · e1663c0c
  1. 1

    nqp::istype(*, Whatever) is 1, so a parameter default of * is recognized as Whatever.

  2. 4

    Empty is definite for type checks — --> Slip:D accepts it and Empty ~~ Slip:D is True — while Empty.defined is False.

More from this test: Concurrency (1), Hashes & sets (1), Classes, roles & the MOP (1), Signatures & dispatch (1).

rakudo-t-language-gaps-7Raku++ passesRakudo passes2026-10-05 · e9cf7c7b
  1. 3

    A subset called as a coercer checks the value, coercing it to the subset's nominal type first.

    Even(56)

  2. 4

    UInt(-3) is X::Coerce::Impossible.

    UInt(-3) is X::Coerce::Impossible

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

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

    An anonymous enum is a type whose members step through one another with .succ/.pred. inferred

  2. 11

    has P() %.h coerces each element at construction. inferred

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

rakuglaze-round-5Raku++ passesRakudo passes2026-10-03 · 60477ffd
  1. 5

    A coercion type with a :D target, X:D(), refuses a type object.

More from this test: Concurrency (1), Containers & assignment (1), Lists & laziness (1), Scoping & phasers (1).

range-construction-and-membershipRaku++ passesRakudo passes2026-09-22 · 1c853075
  1. 7

    A native type has a .Range giving the values it can hold.

    uint64.Range contains 2**64-1

More from this test: Lists & laziness (4), Numerics (2), Operators (1).

range-endpoint-objectsRaku++ passesRakudo passes2026-07-25 · eb83f545
  1. 1

    A Range keeps the endpoint objects it was written with: a Real or undefined endpoint stays as it is, a Str endpoint is numified, and a list endpoint becomes its element count.

    1/2 .. 1/3 gists 0.5..<1/3>, not 0.5..0.3333…

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

regex-closure-and-io-dotRaku++ passesRakudo passes2026-08-05 · f1028af9
  1. 5

    * is a Whatever value, not a wildcard that satisfies any type constraint.

More from this test: I/O & processes (2), Regexes & grammars (2).

return-check-sees-through-bound-attributeRaku++ passesRakudo passes2026-10-31 · 5ebfc05f · #77
  1. 1

    A method's return type check applies to the value an attribute bound with := holds when that attribute is returned.

    method model(--> Mu:U) { $!model := $type; $!model } returns the type

return-type-sibling-refusedRaku++ passesRakudo passes2026-11-08 · 56a7962d
  1. 1

    A return type of Buf refuses a Blob, Hash a Map and Rat a FatRat.

  2. 2

    A Rat-typed variable refuses a FatRat.

    my Rat $r = FatRat.new(1, 2) is refused

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

    A variable declared is an Array subclass that fixes its element type is typed with that element type. inferred

  2. 43

    A coercion type asks the target's COERCE, then the target's own new (with $*COERCION-TYPE set), and the answer must be of the target type. inferred

  3. 44

    A coercion type, with its smiley, can be passed as a role argument. inferred

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

role-state-and-nested-assignRaku++ passesRakudo passes2026-08-14 · e3994d54
  1. 3

    Version.new("v0.0.1") keeps the leading v as a literal part.

    Version.new("v0.0.1").parts[0] eq "v" is True

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

rw-returns-and-container-traitsRaku++ passesRakudo passes2026-08-30 · 9e00135b
  1. 3

    .are(T) answers whether every element smartmatches T, for a list of Pairs as for any other type.

    (1, 2, 3).are(Int) is True

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

scalars-nil-junction-complex-dateRaku++ passesRakudo passes2026-07-27 · ebbe10f3
  1. 3

    .defined on a Junction autothreads and collapses to a plain Bool, which is not the same as .Bool, while .DEFINITE answers for the junction itself.

    (any 0, "").defined is True while its .Bool is False

More from this test: Concurrency (1), Containers & assignment (1), Dates & times (1), Numerics (3), Classes, roles & the MOP (1), Operators (1), Everything else (1), Stringification (1), Syntax & parsing (1).

signal-enum-has-its-namesRaku++ passesRakudo passes2026-09-15 · 148f566b
  1. 1

    Signal's package stash holds its members, so Signal.WHO<SIGPIPE> is the SIGPIPE value and not Any.

    Signal.WHO<SIGPIPE> does not numify to 0

smiley-element-type-keptRaku++ passesRakudo passes2026-11-09 · a776b42a
  1. 1

    A :D or :U smiley on an element type stays on the container, showing in .of, .^name and .raku.

    my Int:D @d is an Array[Int:D] with .of Int:D, and my Int:D %h is a Hash[Int:D]

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

smiley-var-checkedRaku++ passesRakudo cannot run it2026-11-03 · 0d9ea1ca
  1. 1

    A variable's :D or :U constraint is checked by op=, //=, ++, cas and ⚛= as it is by =.

    my Int:D $x = 5; $x = Int dies

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

socket-type-and-regex-expr-interpolationRaku++ passesRakudo passes2026-08-03 · 27cdc0fd
  1. 1

    IO::Socket::INET.new returns a value of type IO::Socket::INET, so it binds to a parameter typed IO::Socket::INET.

    sub accept-loop(IO::Socket::INET $listener) { … } accepts a listener made by IO::Socket::INET.new

More from this test: Regexes & grammars (1).

subset-of-imported-class-param-typeRaku++ passesRakudo passes2026-11-25 · f54b0673 · #278
  1. 1

    A subset of a class imported by its short name refines that class, so the subset's base smartmatches the roles the class does.

    after use Login; subset NotLoggedIn of UserSession where …, a NotLoggedIn parameter's .type ~~ SomeRole is True when UserSession does the role

    Also held by subset-imported.

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

    A Bool mixed in with but is what the value is in every coercion, string and numeric included.

    for True but False, ~ is not "True" and + is not 1

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

systemic-raku-and-version-spellingRaku++ passesRakudo passes2026-11-27 · 0fef8e51
  1. 3

    In a Version string a word part is letters and _ together, and digits are parts of their own.

    a_b is one part; 1_01 is the parts 1, _, 1

More from this test: Stringification (2).

temp-and-env-allomorphRaku++ passesRakudo passes2026-08-14 · 6964d5e4
  1. 2

    A %*ENV value that parses as a number is an allomorph, so a variable set to "0" is an IntStr and false.

    unless %*ENV<ALL_TESTING> fires when the variable is "0"

  2. 3

    A plain Str "0" is true.

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

todo-small-divergencesRaku++ passesRakudo passes2026-10-10 · 79f0bc7c
  1. 4

    Sym(42) with class Sym is Str dies.

  2. 5

    Core type objects refuse .Int, .Num and .Rat, except that a type object asked for its own type answers itself. inferred

    Int.Int is Int

  3. 9

    A typed variable with is default, my Int $x is default(5), still refuses a value of another type such as a Str.

More from this test: Concurrency (1), Containers & assignment (2), Lists & laziness (3), Classes, roles & the MOP (2), Operators (1), Regexes & grammars (1), Scoping & phasers (2), Stringification (3).

todo-small-divergences-2026-10-11Raku++ passesRakudo does not pass2026-10-11 · fc6abf32
  1. 4

    List(@a) on an Array answers the Array itself with its nested Arrays whole.

    for my @w = [1, 2], [3, 4], List(@w).raku is [[1, 2], [3, 4]]

  2. 5

    A coercion type conforms as its target and accepts its source type in a smartmatch.

    Int(Any) ~~ Int is True

  3. 6

    A Promise, a Lock or an IO handle is not Associative.

  4. 16

    utf8.new(…) is a utf8, not a Blob[uint8], and it decodes.

More from this test: Containers & assignment (1), Classes, roles & the MOP (2), Operators (2), Scoping & phasers (1), Signatures & dispatch (2), Strings & Unicode (1), Syntax & parsing (3), divergences (1).

top100-refresh-2026-09-03Raku++ passesRakudo passes2026-09-03 · 3d4ec585
  1. 3

    A subset may be declared over a definite base type, subset S of Str:D, and a following is export(…) trait still applies to the subset.

More from this test: Containers & assignment (1), Signatures & dispatch (1), Stringification (1), Syntax & parsing (1).

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

    An enum member whose value lies beyond the 64-bit integer range keeps its exact value.

    enum Big (Max => 18446744073709551615): Max.value == 18446744073709551615

  2. 2

    Mu is not an Any: nqp::istype(Mu, Any) is 0.

    nqp::istype(Mu, Any) is 0

  3. 3

    For nqp::istype, a buf8 is a Blob but not a Str, a utf8 is not a Buf, an Instant is Real but not a Num, and a Rat is Rational.

    nqp::istype("x".encode, Buf) is 0

  4. 4

    array[uint8].new(…) is an array and its type name carries the element type.

    array[uint8].new(1, 2).^name is array[uint8]

  5. 8

    An attribute may be typed by a constant that aliases a type (constant GType = uint64; has GType $.g) and is then typed by the aliased type.

  6. 11

    A member of a Str enum is a Str: it smartmatches Str, binds to a Str parameter and stringifies to its value, while an Int-valued enum member stringifies to its key.

    our Str enum CSSObj «:AtRule<at-rule>»: ~AtRule is at-rule; enum IntE (n => 5): ~n is n

More from this test: Containers & assignment (1), Exceptions & control flow (2), 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).

type-argument-smiley-nameRaku++ passesRakudo passes2026-11-08 · a797a3c6
  1. 1

    A type argument's smiley stays on it in the parameterized type's name.

    Positional[Int:D].^name is Positional[Int:D] and Hash[Int:D, Str:D] is Hash[Int:D,Str:D]

  2. 3

    Array[Str:D].new checks its elements against the smiley of its element type.

type-coercion-callRaku++ passesRakudo passes2026-07-24 · 4cb81882
  1. 1

    Calling a type as a routine, T(x), coerces the argument by calling its .T method.

typed-buf-elementsRaku++ passesRakudo passes2026-07-31 · eb526782
  1. 1

    The lowercase buffer names such as buf8 are type names, so my buf8 $b .= new constructs a buffer.

    my buf8 $b .= new gives an empty buf8

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

typed-param-refuses-other-type-objectsRaku++ passesRakudo passes2026-10-04 · c1fc5c06
  1. 4

    The Allomorph type object is a Str.

More from this test: Signatures & dispatch (3).

typed-where-variable-refusalRaku++ passesRakudo passes2026-11-09 · edc36182
  1. 1

    A typed variable with a where clause is an anonymous subset of its type: a value the type refuses fails with "expected <anon>" and the clause is never run on it, also for a store through an alias.

    my Int $x where * > 0; $x = "s" fails the type check with "expected <anon>"; my Str $s where *.chars < 3; $s = 12 says "expected <anon>", not "expected Str"

uint-type-constraintRaku++ passesRakudo passes2026-07-29 · 8b7a5485 · #11
  1. 1

    UInt is subset UInt of Int where * >= 0: a non-negative Int satisfies it, a negative Int does not, and a Rat never does, for parameter binding and smartmatch alike.

    sub MAIN(UInt :$pipeline = 15) accepts an explicitly passed 15

undefined-array-head-lvalue-empty-matchRaku++ passesRakudo passes2026-08-20 · a9358900
  1. 1

    .Array and .Hash can be called on a type object or an undefined value; .Array gives a one-element Array holding it.

    Any.Array is [(Any)]

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

value-identityRaku++ passesRakudo passes2026-07-28 · 7768b86c
  1. 2

    A Range is identified by its endpoint form, exclusion markers included, for both === and eqv.

    1..^5 === 1..4 is False

  2. 3

    A parameterised type keeps its parameter when compared.

    Array[Int] eqv Array[Str] is False

  3. 4

    A Code object is identical only to itself.

More from this test: Hashes & sets (1), Numerics (1), Operators (1).

value-role-argument-acceptsRaku++ passesRakudo passes2026-11-08 · 1c681ec5
  1. 1

    A role parameterized by a value matches a parameterization by that value's type, but not the reverse nor one by another value; a class doing the value-parameterized role and .does answer alike.

    R2[1] ~~ R2[Int] is True and R2[Int] ~~ R2[1] is False

version-star-partsRaku++ passesRakudo passes2026-08-28 · 82d03385
  1. 1

    Version.new('*').parts holds the string '*', not a Whatever object.

    Version.new('*').parts[0] eq 'v' is a plain False, not a WhateverCode

version-wildcards-and-io-succRaku++ passesRakudo passes2026-07-27 · 40bb85d6
  1. 4

    .succ and .pred keep the invocant's type, so an IO::Path stays an IO::Path.

More from this test: Operators (3).

which-identity-and-set-op-elementsRaku++ passesRakudo passes2026-07-27 · d8735776
  1. 1

    .WHICH is a canonical identity: an allomorph carries both halves, a Rat its exact numerator and denominator, a Complex its two parts, and a Bool 1 or 0.

    IntStr|Int|42|Str|42 for <42>, and Rat|421/10 for 42.1

More from this test: Hashes & sets (1).

zef-ecosystem-clusterRaku++ passesRakudo passes2026-07-25 · 0cefd08b
  1. 7

    Buf.append with a Blob argument appends the blob's bytes.

More from this test: I/O & processes (2), Regexes & grammars (3), Scoping & phasers (1).

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

    Any.hash is an empty Hash.

More from this test: Containers & assignment (1), Exceptions & control flow (3), Modules (1).