Variable i is typed as Int and then assigned to variable s using the unsafe cast cast i. This causes s to be of an unknown type, a monomorph. Following the usual rules of unification, it can then be bound to any type, such as String in this example.

These casts are called "unsafe" because the runtime behavior for invalid casts is not defined. While most dynamic targets are likely to work, it might lead to undefined errors on static targets.