From c9f8ccf9017a0040217705f71b19a7504b78b654 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 25 Mar 2015 19:37:00 +0100 Subject: [PATCH] Fix interrogate bug with detecting parameter coercion possibility --- .../interrogate/interfaceMakerPythonNative.cxx | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index 4e928c8e6d..7770cd748a 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -4244,6 +4244,10 @@ write_function_forset(ostream &out, for (sii = remaps.begin(); sii != remaps.end(); sii ++) { remap = (*sii); if (!is_remap_coercion_possible(remap)) { + indent(out, indent_level) + << "// No coercion possible: "; + remap->write_orig_prototype(out, 0, false, (max_num_args - min_num_args)); + out << "\n"; continue; } @@ -5143,14 +5147,8 @@ write_function_instance(ostream &out, FunctionRemap *remap, method_prefix = classNameFromCppName(this_class_name, false) + string("."); } - if (coercion_possible) { - if (has_coerce_constructor(obj_type->as_struct_type()) == 0) { - // Doesn't actually have a coerce constructor. - coercion_possible = false; - } - } - - if (coercion_possible) { + if (coercion_possible && + has_coerce_constructor(obj_type->as_struct_type())) { // Call the coercion function directly, which will try to // extract the pointer directly before trying coercion. string coerce_call; @@ -6527,7 +6525,6 @@ is_remap_coercion_possible(FunctionRemap *remap) { // It has a coercion constructor, so go for it. return true; } - break; } ++pn; }