Skip to content

Upcasting T: Message to AnyObject #844

Description

@madsmtm

If all you know about a type is that it is T: Message (or T: ClassType), then you can't safely get AnyObject from that. Probably a rare case, usually you're working with a concrete type, and then you'll simply be able to .as_ref() or deref to it, but would be nice to have.

Maybe it would make sense to add a fn as_any(&self) -> &AnyObject where Self: 'static to Message?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-objc2Affects the `objc2`, `objc2-exception-helper` and/or `objc2-encode` cratesenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions