<FromGitter>
<Blacksmoke16> there are no union types in that example
jmdaemon has quit [Ping timeout: 256 seconds]
<FromGitter>
<Blacksmoke16> > When you use the .class or typeof() method in Crystal, it returns the class of the object at runtime, not the type that was specified in the variable declaration. The type specified in the variable declaration is used at compile-time for type checking, but it does not affect the value of the object at runtime. ⏎ > ⏎ > In your example, the variable grid_offset_y is defined as a union of UInt16 and
<FromGitter>
... Int32, but at runtime, it can only ever be an instance of one of those classes. The .class or typeof() method will return the class of the actual object that is assigned to the variable, which will be either UInt16 or Int32, not the union of the two. ⏎ ⏎ to clarify, *only* `.class` would show you its runtime type. `typeof` is i ... [https://gitter.im/crystal-lang/crystal?at=63c76cdb8fd38605368b5ebc]