summaryrefslogtreecommitdiffstats
path: root/generator/cppgenerator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'generator/cppgenerator.cpp')
-rw-r--r--generator/cppgenerator.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp
index 41267eff..1c9c90fa 100644
--- a/generator/cppgenerator.cpp
+++ b/generator/cppgenerator.cpp
@@ -1818,11 +1818,18 @@ void CppGenerator::writeNamedArgumentResolution(QTextStream& s, const AbstractMe
Indentation indent(INDENT);
s << INDENT << "errorArgName = \"" << arg->name() << "\";" << endl;
}
- s << INDENT << "else" << endl;
+ s << INDENT << "else if (";
+ writeTypeCheck(s, arg->type(), "value", isNumber(arg->type()->typeEntry()));
+ s << ')' << endl;
{
Indentation indent(INDENT);
s << INDENT << pyArgName << " = value;" << endl;
}
+ s << "else" << endl;
+ {
+ Indentation indent(INDENT);
+ s << INDENT << "goto " << cpythonFunctionName(func) << "_TypeError;" << endl;
+ }
}
s << INDENT << '}' << endl;
s << INDENT;