Avoid a type error with a non-null default value for an optional nullable primitive argument.

This commit is contained in:
Ms2ger 2014-03-06 22:26:12 +01:00
parent 8b5778993a
commit 716e1ce144
3 changed files with 22 additions and 18 deletions

View file

@ -1274,6 +1274,10 @@ for (uint32_t i = 0; i < length; ++i) {
else:
assert(tag == IDLType.Tags.bool)
defaultStr = toStringBool(defaultValue.value)
if type.nullable():
defaultStr = "Some(%s)" % defaultStr
template = CGWrapper(CGIndenter(CGGeneric(template)),
pre="if ${haveValue} {\n",
post=("\n"