Skip to content
This repository has been archived by the owner on Nov 18, 2020. It is now read-only.

Latest commit

 

History

History
5 lines (3 loc) · 319 Bytes

casting.md

File metadata and controls

5 lines (3 loc) · 319 Bytes

Casting with as

as! will cast a value to a given type and panic if the cast fails. as? will cast a value to the nullable of the given type, returning error Result<T> if the cast fails. as will perform a statically safe cast. That is a cast up or widening conversion

NOTE: downcasting is never allowed.