Skip to content

High-level bindings should have more implicit derived-to-base conversions #33

@jfirebaugh

Description

@jfirebaugh

#26 was a good start, but we should go further:

  • Object<T>::Set(env, field, value) should allow an implicit derived-to-base conversion from value's type (derived) to the type of the field (base).
  • Object<T>::Call(env, method, arg) should allow an implicit derived-to-base argument from arg's type (derived) to the corresponding argument type of the method (base).
  • ...and so on

Right now, template parameters constrain these types to be identical. For example, if you try Call a method that's expecting a Object<> parameter, and pass a jni::String, you get an error "no matching member function for call to 'Call'", "candidate template ignored: deduced conflicting types for parameter 'Args' (<jni::Object<jni::ObjectTag>> vs. <jni::Object<jni::StringTag>>)".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions