Skip to content

Add safe upcasting #518

@madsmtm

Description

@madsmtm

We already have the ability to convert from NSView to its superclasses NSResponder using Deref, ClassType::as_super or Id::into_super. In general, we should maybe consider an UpCast trait of some sort, to be able to do this fully generically? Even better if it could integrate with a From implementation for Id.

See also the inverse of this in #474.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-frameworkAffects the framework crates and the translator for themA-objc2Affects the `objc2`, `objc2-exception-helper` and/or `objc2-encode` cratesenhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions