Skip to content

Compatibility

Ferret favors explicit conversion.

let x: i64 = 42
let y: i32 = x as i32

For interfaces and unions, narrowing usually uses is checks before use:

if value is Name {
let narrowed: Name = value
println(narrowed.value)
}