Course of Raku / Advanced / More about built-in types / Native types 🆕 / Machine-level types

Quiz — Native types

What does the following program print?

my int $n = 42;
say $n.^name;
1Int
0int
0(Int)
0Num

When you introspect a native value, it is automatically boxed into the matching full type. So even though $n is declared as a native int, asking for its type name through .^name reports the boxed Int.

Course navigation

Machine-level types   |   Sized types and overflow