-
Notifications
You must be signed in to change notification settings - Fork 0
Description
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.