Skip to content

encode should return ? for types that don't implement Encode #11

Closed
@SSheldon

Description

@SSheldon

Implementing #10 would currently require that any type used in a method argument must implement Encode. This is difficult for cases like functions, whose ObjC type encoding is just '?' but it's hard to implement Encode for all fns (because there's fn() -> R, extern fn() -> R, unsafe extern fn() -> R, unsafe fn() -> R, fn(A) -> R, etc).

It'd be simplest if encode<fn()> == "?" without implementing Encode for fn(), and then if Encode isn't implemented when it should be, it would just be an error at runtime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions