Custom type coercion is described in Type conversion and testing.