diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2011-01-03 15:34:35 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2011-01-03 15:35:27 -0300 |
commit | 3d2aef81fb97baefdc4b3a35a86076a8ed377100 (patch) | |
tree | 0693e4406f3f618bfca42edeccf348a1ed7282b0 | |
parent | 7563560d32c91d0cf58567358a0f0f85c590056f (diff) | |
download | shiboken-3d2aef81fb97baefdc4b3a35a86076a8ed377100.tar.gz shiboken-3d2aef81fb97baefdc4b3a35a86076a8ed377100.tar.xz shiboken-3d2aef81fb97baefdc4b3a35a86076a8ed377100.zip |
A convertible check must be done on named arguments as it is done on regular arguments.
-rw-r--r-- | generator/cppgenerator.cpp | 9 |
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; |