diff options
-rw-r--r-- | sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp index 093b2fb68..2364cec7a 100644 --- a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp +++ b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp @@ -1863,7 +1863,9 @@ AbstractMetaFunction *AbstractMetaBuilderPrivate::traverseFunction(const Functio AbstractMetaType *metaType = translateType(arg->type(), currentClass, {}, &errorMessage); if (!metaType) { // If an invalid argument has a default value, simply remove it - if (arg->defaultValue()) { + // unless the function is virtual (since the override in the + // wrapper can then not correctly be generated). + if (arg->defaultValue() && !functionItem->isVirtual()) { if (!currentClass || (currentClass->typeEntry()->codeGeneration() & TypeEntry::GenerateTargetLang)) { |