Skip to content

Relaxed Parameter Matching for Overload Resolution in Reflected Calls #70

@neeraj31285

Description

@neeraj31285

Currently, RTL requires exact signature binding when invoking reflected methods. For example:

rtl::type().member<std::vector>().method<const int&>("push_back").build(&std::vector::push_back);

// Fails with rtl::error::SignatureMismatch unless the signature is explicitly specified:
auto [err, ret] = push->bind<const int&>(robj).call(38);

However, in standard C++, an rvalue int can bind directly to const int&. Developers expect RTL to mirror this behavior:

// Should work without explicit signature binding
auto [err, ret] = push->bind(robj).call(38);

Important Nuance:

If only a single overload exists, RTL already resolves correctly: an int argument will bind to a const int& parameter without explicit bind().

The issue arises only with overload sets, where implicit conversions should still be considered for disambiguation, but RTL currently fails with SignatureMismatch.

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