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 probes- 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 probeslowercase-typesRaku++ matches Rakudo on 18 of 47 probes- 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 probes- 1
A type name followed by
(is a coercion even when a sub of the same name is declared:sub Int($x)does not captureInt(42).with
sub Int($x)declared,Int(42)is still the coercionAlso held by
bound-type-names.
shadow-subsetRaku++ matches Rakudo on 37 of 38 probes- 1
subset Int of Cool …makes the nameInta subset where the declaration is in scope.
allomorph-numeric-sheds-the-strRaku++ passesRakudo passes- 1
.Numericand.Realon an allomorph return the plain number, without the allomorph's string side.~ <0o755>.Numericis493
More from this test: divergences (1).
allomorph-str-methodsRaku++ passesRakudo passes- 1
An allomorph is a Str and takes Str methods.
<42>.parse-base(16)is66
More from this test: Regexes & grammars (1).
audited-language-gaps-2Raku++ passesRakudo passes- 3
The value of an
enumdeclaration 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 passes- 1
A
blob32holds 32-bit elements:.elemscounts elements, a subscript reads a whole element, and its numeric value is the element count. inferredblob32.new(0x11223344, 5).elemsis 2 - 2
A typed blob assigns its elements into a native-int array (
my uint32 @W = $b), and@$blists its elements. inferred
More from this test: Numerics (2), Syntax & parsing (2).
blob-not-str-and-position-edgesRaku++ passesRakudo passes- 1
A
Blobhas no Str methods:.uc,.lc,.flip,.ord,.substr,.trim,.contains,.linesand the like die on it, and so do the sub forms such asuc($buf).Buf.new(1).ucdies with no such method
More from this test: Strings & Unicode (3).
blob-numeric-and-zip-metaopRaku++ passesRakudo passes- 1
A Blob in numeric context is its element count. inferred
- 2
Blob ~ Blobis 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 passes- 3
subbuf-rwrefuses a Blob.
More from this test: Containers & assignment (1).
bson-simple-and-hash-agnosticRaku++ passesRakudo passes- 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 pass- 1
A
DateTimeis notAssociative:DateTime ~~ Associativeis False.DateTime ~~ Associativeis FalseAlso held by
istype-dateish-role.
buf-param-refuses-blobRaku++ passesRakudo passesbuf-signed-element-typeRaku++ passesRakudo passes- 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 pass- 2
A buffer write method can be called on a temporary invocant, as in
buf8.new.write-num64(...). - 4
Boolis anInt-backed enum, soTrue ~~ Intis True.
More from this test: Numerics (1), Syntax & parsing (1).
code-accepts-and-regex-callableRaku++ passesRakudo passes- 2
A Regex is a Method, hence a Routine, Block, Code and Callable, and binds to a
Callable:Dparameter. - 3
.ACCEPTSon 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 passes- 1
Coercing to a class that derives a boxed built-in (
class Sym is Str, likewise Int, Num or Rat) goes throughT.new(x)on every route: the literal callSym('b'), a type held in a variable, aSym()parameter, a role'sT($v)and the short name of the class inside its own package.Sym('b')withclass Sym is Strgives a Sym
coercion-type-converts-on-assignmentRaku++ passesRakudo passes- 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, asmy Int() $x = "7"does
coercion-typed-containerRaku++ passesRakudo passes- 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 => 42stores a Str - 2
A Map is not a Hash, so a
Hash()coercion type converts a Map into a mutable Hash.my Hash() %options = %defaultsover a Map of Maps stores Hashes
coercion-typed-element-storesRaku++ passesRakudo passes- 1
A coercion-typed container such as
my Hash() %h(aHash[Hash(Any)], as.ofshows) 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 passes- 3
IntStr.new,RatStr.new,NumStr.newandComplexStr.newtype-check their arguments as(Int:D $i, Str:D $s)and the like.IntStr.new("x", "y")dies bindingInt:D $i
compound-assign-typecheckRaku++ passesRakudo passes- 2
A compound assignment to a variable with a coercion type converts the result.
my Int() $c = 1; $c /= 2holds0
More from this test: Containers & assignment (2).
conformance-list-adverbsRaku++ passesRakudo passes- 8
A
Ratparameter rejects anInt(3 ~~ Ratis False), soduckmap -> Rat $_ {…}descends past Ints.
More from this test: Lists & laziness (6), Operators (1).
conformance-missing-routinesRaku++ passesRakudo passes- 1
Junction.new(kind, elems)is the constructor spelling ofany(),all()andone().
More from this test: I/O & processes (1), Stringification (1), divergences (1).
conformance-phase1-reprRaku++ passesRakudo passes- 6
blob8isBlob[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 passes- 10
A
Strcoerces toDate,DateTimeandVersionwith.Date,.DateTimeand.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 passes- 4
A Range does Positional.
More from this test: Lists & laziness (3), Operators (1).
definiteness-types-and-runtime-classesRaku++ passesRakudo passes- 1
Foo:DandFoo:Uare types in term position:.^namereports the smiley, smartmatch tests definedness along with the type, and.^base_typestrips it off.
More from this test: Classes, roles & the MOP (2).
dist-suite-quartetRaku++ passesRakudo passes- 2
IO::Pathis Cool and does IO but is not Stringy. - 20
An enum value is callable like its type.
WARNING(TRACE)isTRACE
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 passes- 2
.^nameon a junction answersJunctionfor the junction itself without autothreading, while ordinary methods such as.succand.Strautothread. inferred(1 & 2).^nameisJunction;(1 & 2).succgistsall(2, 3)
More from this test: Lists & laziness (3), Numerics (3), Operators (2).
doc-missing-methodsRaku++ passesRakudo cannot run it- 1
Buf.splicemutates the buffer in place and returns the removed bytes.Buf.new(1,1,2,3,5).splice(0, 3, <3 2 1>)gistsBuf:0x<01 01 02>and leavesBuf.new(3,2,1,3,5) - 4
Blob.unpackdecodes by template (C*every byte,A3a counted string,nbig-endian 16-bit), returning the bare value for a single result and a List for several. inferredBlob.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 passes- 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 passes- 2
$*USERand$*GROUPare IntStr allomorphs.$*USER.^nameisIntStr - 13
Mu ~~ Anyis False andAny ~~ Muis 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 passes- 1
An enum value numifies to a plain Int:
.Numericand prefix+give the underlying integer, as.Intand.valuedo.
enum-package-qualified-typeRaku++ passesRakudo passes- 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 $.opcodeacceptsOpcode::Textfrompackage Cro::WebSocket::Message { enum Opcode … }
enum-type-called-from-a-containerRaku++ passesRakudo passes- 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)areCCC, asMyEnum(2)is - 2
A Scalar holding an enum's type object still holds a type object: it prints as one, smartmatches
Int, has the enum's.^mroand can initialize amy Intvariable.$t ~~ IntisTrueandmy Int $i = $tworks
enum-type-object-is-one-itemRaku++ passesRakudo passes- 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"",.elemsis 1 andmy @a = MyEnumtakes one element - 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 passes- 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 passes- 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 passes- 4
A Whatever held in a variable stays a Whatever when used as a Pair's key.
my $w = *; ($w => 1).rakuis* => 1
More from this test: Containers & assignment (1), Hashes & sets (1).
exe-typed-store-checkedRaku++ passesRakudo cannot run it- 1
op=and++on a typed scalar check the stored value against the variable's type as=does.my Small $x = 5; $x += 100dies
exe-value-semanticsRaku++ passesRakudo passes- 2
A bare block
{ 1 }is a Block, not a Sub.{ 1 }.^nameis 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 it- 1
A variable's
whereconstraint 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 += 100dies
exported-nested-class-coercionRaku++ passesRakudo passes- 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 exportinsideunit class Gnome::Glib::T-error, an importer'smy N-Error() $ne = $errorcallsCOERCE
forward-types-and-statement-endRaku++ passesRakudo passes- 3
A value that already is of a coercion type's target type is not coerced.
Cool() $cgiven a Str keeps the Str;Int() $xgiven True keeps the BoolAlso held by
only-ellipsis-bracketed-infix.
More from this test: Syntax & parsing (1).
getopt-long-parameter-traitsRaku++ passesRakudo passes- 5
The type of a coercion-typed parameter
Foo(Str) :$foois a coercion type: its name isFoo(Str), its HOW is aMetamodel::CoercionHOW, and.^constraint_type,.^target_typeand.^coerceanswer..^constraint_typeisStrand.^target_typeisFoo
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 passes- 1
Boolis anInt:.isa(Int),.does(Int)and~~ Intall hold andIntis inBool.^mro.Bool.^mrois Bool, Int, Cool, Any, Mu - 2
Strdoes theStringyrole:.does(Stringy)and~~ Stringyare True, while.isa(Stringy)is False and the role is not inStr.^mro.Str.^mrois Str, Cool, Any, Mu - 3
An allomorph is both its numeric type and a
Strfor~~,.isaand.^mro.<5>.isa(Str)is True;IntStr.^mrois IntStr, Allomorph, Str, Int, Cool, Any, Mu - 4
Realis a role, so5.isa(Real)is False while5 ~~ Realis True, andFatRatis not aRat.FatRat ~~ Ratis False
hash-map-pair-semantics-sheetRaku++ passesRakudo passes- 23
A Pair is a value type only while its value is one: its
.WHICHis then a ValueObjAt, two equal such Pairs are===, and.uniquefollows that. inferred(a => 1) === (a => 1)isTrue;(a => [1]) === (a => [1])isFalse
More from this test: Containers & assignment (3), Hashes & sets (13), Operators (4), Stringification (5).
http-simple-clusterRaku++ passesRakudo passes- 2
Buf.newandBlob.newgiven 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)).listis(1, 2, 3);Buf.new($src, 4)dies
More from this test: Syntax & parsing (1).
interp-meta-mixin-block-sig-allomorphRaku++ passesRakudo passes- 5
An allomorph is identical to neither of its halves for
===,eqvand 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 passes- 7
A Range's
.WHICHcontains 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 passes- 5
.enumscalled 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 passes- 2
A coercion-typed attribute coerces the value the constructor is given.
has Date() $.dgiven a Str holds a Date
More from this test: Classes, roles & the MOP (2).
issue-116-module-type-short-namesRaku++ passesRakudo passes- 2
Cursoris the setting's old name for Match, so aCursor-typed container accepts a Match.has Cursor $.cursoraccepts a Match
More from this test: Modules (1), Regexes & grammars (1).
issue-222-parameterized-role-arguments-smartmatchRaku++ passesRakudo passes- 1
Two parameterizations of one role smartmatch when each argument on the right accepts the one on the left.
Positional[Int] ~~ Positional[Mu]is TrueAlso held by
type-argument-smiley-name. - 2
Two parameterizations of one class smartmatch only when their arguments are identical.
Array[Int] !~~ Array[Numeric] - 3
In a smartmatch of two role parameterizations, a
:Dargument on the right takes only itself, and a:Uor bare one asks the nominal type.Positional[Int:D] !~~ Positional[Numeric:D]
issue276-builtin-coercer-callsRaku++ passesRakudo passes- 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, andBlob(1, 2)a Blob from its elementsAlso held by
coercer-calls. - 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
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 it- 3
Assigning to a coercion-typed
is rwattribute (has Str() $.uri is rw) coerces the value, as.newdoes.$c.uri = $path.IOis 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 it- 6
Invoking an undefined
Anyvalue is theAnycoercion, 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 passes- 1
atomicintis a native integer type everywhere, differing fromintonly in allowing the⚛operators: it binds anatomicintparameter, matches Int, and serves as a native array element type.my atomicint $n = 0; sub f(atomicint $x) {…}; f($n)binds;atomicint ~~ IntisTrue
istype-dateish-roleRaku++ passesRakudo passes- 1
nqp::istype($dt, Dateish)is true for a Date or DateTime, agreeing with$dt ~~ Dateish.
js-backend-framework-clusterRaku++ passesRakudo passes- 7
A type with a
:Dsmiley on the right of~~is False for the type object itself. inferredTag ~~ Tag:DisFalse
More from this test: Operators (1), Scoping & phasers (2), Signatures & dispatch (1), Strings & Unicode (1), Syntax & parsing (2).
json-fast-clusterRaku++ passesRakudo does not pass- 1
An enum value does
Enumerationand smartmatches its own enum type.Squee ~~ Enumerationis True;5 ~~ Enumerationis False - 2
An enum declared from pairs keeps each pair's value.
enum Blerp (One => "Eins", Two => "Zwei"); One.valueisEins - 3
An enum type object is undefined, so
withdoes not fire on it.Bloop.definedis False - 4
An enum's stash holds its values,
Bool::included.Bool::.values.sortis(False, True) - 6
nqp::istyperecognises a role that an object does, and a Failure asFailure.nqp::istype(TC.new, Associative)is true forclass TC does Positional does Associative - 7
.Raton a RatStr is a plain Rat and.Inton an IntStr is a plain Int.RatStr.new(0.5, "x").Rat.^nameisRat
More from this test: Containers & assignment (1), Numerics (1), Operators (1), Signatures & dispatch (1), Strings & Unicode (1).
kernel-bool-variablesRaku++ passesRakudo passes- 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 passes- 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 EXPORTormy constant Bar = Foo— is not lost to an unrelatedclass Barelsewhere in the program.with
Baraliased toFoo,my Bar $v = Bar.newpasses its type check
list-array-semantics-sheetRaku++ passesRakudo passes- 5
Array[Int].newtype-checks its elements and throws X::TypeCheck::Assignment for a wrong one. inferredArray[Int].new("a")throws X::TypeCheck::Assignment - 21
An Array identifies by object (
.WHICHis an ObjAt) and an Int by value (ValueObjAt). inferred[1, 2].WHICH.^nameisObjAt
More from this test: Containers & assignment (7), Exceptions & control flow (1), Lists & laziness (11), Stringification (3).
listop-angle-words-unicodeRaku++ passesRakudo passes- 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 passes- 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 passes- 1
A user type whose name starts with a lowercase letter is a type in a declaration:
my foo_t $xstarts as(foo_t), is type-checked, andmy foo_t $x .= newconstructs afoo_t.my cairo_matrix_t $matrix .= newconstructs a cairo_matrix_tAlso held by
lowercase-types.
math-nintegrate-fixesRaku++ passesRakudo passes- 4
An angle word that spells
Inf(with or without a sign) orNaNis a NumStr, and a leading U+2212 is a minus sign.<x -Inf Inf>holds NumStrs for-InfandInf
More from this test: Regexes & grammars (1), Signatures & dispatch (3), Syntax & parsing (1).
modinfo-ecosystem-clusterRaku++ passesRakudo passes- 3
::?CLASSwith 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 passes- 1
Calling a type object as
T(x)on a class with no CALL-ME runs the coercion chain: the argument's own.Tmethod if it has one, thenT.COERCE(x), thenT.new(x).Locale::Dates("EN")ends inLocale::Dates.new("EN")
More from this test: Exceptions & control flow (1), Operators (1), Signatures & dispatch (1).
named-subsig-pair-and-nested-coercion-smileyRaku++ passesRakudo passes- 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 pass- 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
--> numtakes a Num or a NumStr,--> intan Int (a Bool is 1) and--> stra Str or an allomorph; a type object cannot unbox, and Nil passes as through any return type.
native-smartmatch-and-whatever-valuesRaku++ passesRakudo passes- 3
A lone
*is a Whatever value, not a closure.after
my $w = *,$w ~~ WhateverisTrue - 4
A curried
*expression held in a variable is a WhateverCode, so*-1in a variable subscripts from the end and its.WHATis(WhateverCode), not(Sub). - 9
A type with a definedness smiley in term position keeps the smiley in its name.
Any:D.^nameis not"Any"
More from this test: Exceptions & control flow (1), Operators (5).
nominal-type-checksRaku++ passesRakudo passes- 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 theAnytype object.A.new ~~ CoolisFalse - 4
The value
.WHICHreturns binds anObjAtparameter and does not bindStrorStringy. inferred - 6
A typed
$variable or attribute checks any nominal type on assignment, somy Array $x = (1, 2),my Any $y = Mu,my Any $z = 1|2andhas Any $.agivenMuall die with a type check.my Any $x = Mudies
More from this test: Signatures & dispatch (3).
non-ascii-names-bind-and-typeRaku++ passesRakudo passes- 2
A type whose name starts with a non-ASCII letter types a variable like any other:
my Еоо $xhas the(Еоо)default, takes.= new, type-checks assignment, andmy Еоо @ahas that.of.class Еоо { }; my Еоо $foo; say $foodoes not print(Any)
More from this test: Syntax & parsing (1).
nqp-iterator-buffer-and-bindattrRaku++ passesRakudo passes- 3
A native
strarray accepts a Str that has a role mixed in.a
"bar" but Type<words>value can be stored in astrarray
More from this test: Containers & assignment (1), Lists & laziness (1).
nqp-scope-and-listRaku++ passesRakudo passes- 1
An
Arrayis not aSeq, while the lazy result of.mapis one.
More from this test: Scoping & phasers (1).
numeric-coercions-and-refusalsRaku++ passesRakudo does not pass- 3
Assigning a negative number to a
UIntvariable fails the type check.my UInt $x = -42is refused - 4
Int.newgiven a type object is refused, since a type object has no value to convert.Int.new(Int)is not0
More from this test: Compile-time errors (1), Numerics (3).
optional-subset-param-defaultRaku++ passesRakudo passes- 2
A subset type smartmatches itself.
CN ~~ CNis True
More from this test: Signatures & dispatch (1).
pair-and-list-are-immutableRaku++ passesRakudo passes- 3
A Pair is Associative.
(a => 1) ~~ Associativeis True
More from this test: Containers & assignment (3).
parameterized-decl-bind-posRaku++ passesRakudo passes- 1
A parameterized type in declarator position (
my Pair[Int] $x) names the same type that the expressionPair[Int]evaluates to.
More from this test: Containers & assignment (1), Operators (1).
parameterized-type-smartmatchRaku++ passesRakudo does not pass- 1
A parameterized type is smartmatched by its parameter as well as its base type.
Array[Int] ~~ Array[Str]andHash[Int] ~~ Hash[Str]areFalse
pdf-family-2026-09Raku++ passesRakudo passes- 20
A native array is an
array, and is neither anArraynor aList. - 41
An instance of a class declared
class T is Str { has $.value }is the string it was built with. - 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 passes- 2
$*RAKU, aLock::Async, aCompUnit::DependencySpecification, a wrap handle, aCompUnitand anIO::Pipedo not smartmatchAssociative. - 3
An
IO::Path::PartsisAssociativebut is not aMap.
More from this test: Hashes & sets (1).
rak-chain-install-gapsRaku++ passesRakudo passes- 1
nqp::istype(*, Whatever)is 1, so a parameter default of*is recognized as Whatever. - 4
Emptyis definite for type checks —--> Slip:Daccepts it andEmpty ~~ Slip:Dis True — whileEmpty.definedis False.
More from this test: Concurrency (1), Hashes & sets (1), Classes, roles & the MOP (1), Signatures & dispatch (1).
rakudo-t-language-gaps-7Raku++ passesRakudo passes- 3
A subset called as a coercer checks the value, coercing it to the subset's nominal type first.
Even(56) - 4
UInt(-3)isX::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 passes- 10
An anonymous enum is a type whose members step through one another with
.succ/.pred. inferred - 11
has P() %.hcoerces 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 passes- 5
A coercion type with a
:Dtarget,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 passes- 7
A native type has a
.Rangegiving the values it can hold.uint64.Rangecontains2**64-1
More from this test: Lists & laziness (4), Numerics (2), Operators (1).
range-endpoint-objectsRaku++ passesRakudo passes- 1
A
Rangekeeps the endpoint objects it was written with: aRealor undefined endpoint stays as it is, aStrendpoint is numified, and a list endpoint becomes its element count.1/2 .. 1/3gists0.5..<1/3>, not0.5..0.3333…
More from this test: Lists & laziness (1).
regex-closure-and-io-dotRaku++ passesRakudo passes- 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 passes- 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 passesroast-sweep-runtimeRaku++ passesRakudo cannot run it- 39
A variable declared
isan Array subclass that fixes its element type is typed with that element type. inferred - 43
A coercion type asks the target's
COERCE, then the target's ownnew(with$*COERCION-TYPEset), and the answer must be of the target type. inferred - 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 passes- 3
Version.new("v0.0.1")keeps the leadingvas 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 passes- 3
.are(T)answers whether every element smartmatchesT, 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 passes- 3
.definedon a Junction autothreads and collapses to a plain Bool, which is not the same as.Bool, while.DEFINITEanswers for the junction itself.(any 0, "").definedis True while its.Boolis 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 passes- 1
Signal's package stash holds its members, soSignal.WHO<SIGPIPE>is theSIGPIPEvalue and not Any.Signal.WHO<SIGPIPE>does not numify to 0
smiley-element-type-keptRaku++ passesRakudo passes- 1
A
:Dor:Usmiley on an element type stays on the container, showing in.of,.^nameand.raku.my Int:D @dis anArray[Int:D]with.ofInt:D, andmy Int:D %his aHash[Int:D]
More from this test: Containers & assignment (2).
smiley-var-checkedRaku++ passesRakudo cannot run it- 1
A variable's
:Dor:Uconstraint is checked byop=,//=,++,casand⚛=as it is by=.my Int:D $x = 5; $x = Intdies
More from this test: Containers & assignment (1), Scoping & phasers (1).
socket-type-and-regex-expr-interpolationRaku++ passesRakudo passes- 1
IO::Socket::INET.newreturns a value of typeIO::Socket::INET, so it binds to a parameter typedIO::Socket::INET.sub accept-loop(IO::Socket::INET $listener) { … }accepts a listener made byIO::Socket::INET.new
More from this test: Regexes & grammars (1).
subset-of-imported-class-param-typeRaku++ passesRakudo passes- 1
A
subsetof 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 ~~ SomeRoleis True when UserSession does the roleAlso held by
subset-imported.
superscript-call-but-bool-redo-copy-and-friendsRaku++ passesRakudo passes- 2
A Bool mixed in with
butis what the value is in every coercion, string and numeric included.for
True but False,~is not"True"and+is not1
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 passes- 3
In a Version string a word part is letters and
_together, and digits are parts of their own.a_bis one part;1_01is the parts 1,_, 1
More from this test: Stringification (2).
temp-and-env-allomorphRaku++ passesRakudo passes- 2
A
%*ENVvalue 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" - 3
A plain Str "0" is true.
More from this test: Scoping & phasers (1).
todo-small-divergencesRaku++ passesRakudo passes- 4
Sym(42)withclass Sym is Strdies. - 5
Core type objects refuse
.Int,.Numand.Rat, except that a type object asked for its own type answers itself. inferredInt.IntisInt - 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 pass- 4
List(@a)on an Array answers the Array itself with its nested Arrays whole.for
my @w = [1, 2], [3, 4],List(@w).rakuis[[1, 2], [3, 4]] - 5
A coercion type conforms as its target and accepts its source type in a smartmatch.
Int(Any) ~~ Intis True - 6
A Promise, a Lock or an IO handle is not Associative.
- 16
utf8.new(…)is autf8, not aBlob[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 passes- 3
A subset may be declared over a definite base type,
subset S of Str:D, and a followingis 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 pass- 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
Muis not anAny:nqp::istype(Mu, Any)is 0.nqp::istype(Mu, Any)is0 - 3
For
nqp::istype, abuf8is aBlobbut not aStr, autf8is not aBuf, anInstantisRealbut not aNum, and a Rat isRational.nqp::istype("x".encode, Buf)is0 - 4
array[uint8].new(…)is anarrayand its type name carries the element type.array[uint8].new(1, 2).^nameisarray[uint8] - 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. - 11
A member of a
Str enumis a Str: it smartmatchesStr, binds to aStrparameter and stringifies to its value, while an Int-valued enum member stringifies to its key.our Str enum CSSObj «:AtRule<at-rule>»:~AtRuleisat-rule;enum IntE (n => 5):~nisn
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 passestype-coercion-callRaku++ passesRakudo passes- 1
Calling a type as a routine,
T(x), coerces the argument by calling its.Tmethod.
typed-buf-elementsRaku++ passesRakudo passes- 1
The lowercase buffer names such as
buf8are type names, somy buf8 $b .= newconstructs a buffer.my buf8 $b .= newgives an empty buf8
More from this test: Containers & assignment (2).
typed-param-refuses-other-type-objectsRaku++ passesRakudo passes- 4
The Allomorph type object is a Str.
More from this test: Signatures & dispatch (3).
typed-where-variable-refusalRaku++ passesRakudo passes- 1
A typed variable with a
whereclause 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 = 12says "expected <anon>", not "expected Str"
uint-type-constraintRaku++ passesRakudo passes- 1
UIntissubset 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 passes- 1
.Arrayand.Hashcan be called on a type object or an undefined value;.Arraygives a one-element Array holding it.Any.Arrayis[(Any)]
More from this test: Containers & assignment (1), Operators (1).
value-identityRaku++ passesRakudo passes- 2
A Range is identified by its endpoint form, exclusion markers included, for both
===andeqv.1..^5 === 1..4is False - 3
A parameterised type keeps its parameter when compared.
Array[Int] eqv Array[Str]is False - 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 passes- 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
.doesanswer alike.R2[1] ~~ R2[Int]is True andR2[Int] ~~ R2[1]is False
version-star-partsRaku++ passesRakudo passes- 1
Version.new('*').partsholds the string'*', not aWhateverobject.Version.new('*').parts[0] eq 'v'is a plain False, not a WhateverCode
version-wildcards-and-io-succRaku++ passesRakudo passes- 4
.succand.predkeep the invocant's type, so anIO::Pathstays anIO::Path.
More from this test: Operators (3).
which-identity-and-set-op-elementsRaku++ passesRakudo passes- 1
.WHICHis 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|42for<42>, andRat|421/10for42.1
More from this test: Hashes & sets (1).
zef-ecosystem-clusterRaku++ passesRakudo passes- 7
Buf.appendwith aBlobargument appends the blob's bytes.
More from this test: I/O & processes (2), Regexes & grammars (3), Scoping & phasers (1).
zef-install-clusterRaku++ passesRakudo passes- 6
Any.hashis an empty Hash.
More from this test: Containers & assignment (1), Exceptions & control flow (3), Modules (1).