I've experimented with casting many types to AnyObject
. Reference types obviously cast unaltered, but others are automagically converted under the hood to NSNumber
, NSValue
, and so on. (These are not the exact types, but close enough.) I was even able to cast a tuple successfully.
This surprised me. Are there any types that cannot be cast to AnyObject
?
There are other questions and answers that may cover this material, but none of them asks this question specifically and the answer to this question can only be found in the fine print of the other answers.