Content deleted Content added
Changed reference from previous to current page. |
→Type inference and union types: Types were listed in reverse order in comment as resolved by compiler. |
||
Line 90:
<syntaxhighlight lang="crystal">
desired_things = [:unicorns, "butterflies", 1_000_000]
p typeof(desired_things.first) # typeof returns the compile time type, here (
p desired_things.first.class # the class method returns the runtime type, here Symbol
</syntaxhighlight>
|