Support using typedefs with nullable unions.

This commit is contained in:
Ms2ger 2017-02-08 12:18:24 +01:00
parent 8ca1383c41
commit 35bc171a05
2 changed files with 3 additions and 1 deletions

View file

@ -6122,7 +6122,8 @@ class CGBindingRoot(CGThing):
# Do codegen for all the typdefs
for t in typedefs:
if t.innerType.isUnion():
if t.innerType.isUnion() and not t.innerType.nullable():
# Allow using the typedef's name for accessing variants.
cgthings.extend([CGGeneric("\npub use dom::bindings::codegen::UnionTypes::%s as %s;\n\n" %
(t.innerType, t.identifier.name))])
else: