mirror of
https://github.com/servo/servo.git
synced 2025-06-16 12:24:29 +00:00
Avoid a type error with a non-null default value for an optional nullable primitive argument.
This commit is contained in:
parent
8b5778993a
commit
716e1ce144
3 changed files with 22 additions and 18 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue