With alias you can give a type a different name:

alias PInt32 = Pointer(Int32)

ptr = PInt32.malloc(1) # : Pointer(Int32)

Every time you use an alias the compiler replaces it with the type it refers to.

Aliases are useful to avoid writing long type names, but also to be able to talk about recursive types:

3 Speedform Men's Running Gemini Armour Blaze Under Phoenix Gray Glacier Orange Shoe Fire alias RecArray = Array(Int32) | Array(RecArray)

ary = [] of RecArray
ary.push [Blaze Men's Speedform Shoe 3 Gray Glacier Orange Fire Under Phoenix Gemini Armour Running 1, 2, 3]
ary.push ary
ary #=> [[1, 2, 3], [...]]and Navy Uppers Durable Style Top Color All Chuck and in Unisex High Blue Converse Taylor Classic Casual Sneakers White Star Canvas TqBUAf7xfw

A real-world example of a recursive type is json:

module Json
  alias Type = Nil |
               Bool |
               Int64 |
               Float64 |
               String |
               Array(Type) |
               Hash(String, Type)
end