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;| 1 | Int |
| 0 | int |
| 0 | (Int) |
| 0 | Num |
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.