aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-01-03 15:34:35 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:12:52 -0300
commit214dad590fc7e9ff461f2e1fe5ea407caed98ec3 (patch)
tree7e43c769cb037a9c1d7c02e40e1bf9d6f4d7560c
parent8c66872ff9e4a9d1cd4c605abdcdc63ac8396bf9 (diff)
A convertible check must be done on named arguments as it is done on regular arguments.
-rw-r--r--generator/cppgenerator.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp
index e49922b51..b560d6aea 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;