mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-26 22:53:16 -04:00
interrogate: Do not consider make()
with explicit kwargs for coercion
Unless this parameter has a default value
This commit is contained in:
parent
68111b2c42
commit
e09f78b987
@ -872,8 +872,13 @@ setup_properties(const InterrogateFunction &ifunc, InterfaceMaker *interface_mak
|
|||||||
} else if (fname == "make") {
|
} else if (fname == "make") {
|
||||||
if (!_has_this && _parameters.size() >= 1 &&
|
if (!_has_this && _parameters.size() >= 1 &&
|
||||||
TypeManager::is_pointer(_return_type->get_new_type())) {
|
TypeManager::is_pointer(_return_type->get_new_type())) {
|
||||||
// We can use this for coercion.
|
// We can use this for coercion, except if this is a kwargs param that
|
||||||
_flags |= F_coerce_constructor;
|
// does not have a default value.
|
||||||
|
if ((_flags & F_explicit_args) == 0 ||
|
||||||
|
_parameters.size() != first_param + 2 ||
|
||||||
|
_parameters[first_param + 1]._remap->has_default_value()) {
|
||||||
|
_flags |= F_coerce_constructor;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_args_type == InterfaceMaker::AT_varargs) {
|
if (_args_type == InterfaceMaker::AT_varargs) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user