Skip to content

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

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.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions