Upcasting

suggest change

The as operator will cast to a supertype. As it cannot fail, it does not return an optional.

let name = "Ringo"
let value = string as Any  // `value` is of type `Any` now

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents