Properly generate typedef identities in unions

This commit is contained in:
Keith Yeung 2016-09-07 21:45:54 -07:00
parent 3631e314b9
commit 3976d974fc
4 changed files with 23 additions and 6 deletions

View file

@ -2491,10 +2491,18 @@ class IDLUnionType(IDLType):
return type.name
for (i, type) in enumerate(self.memberTypes):
if not type.isComplete():
# Exclude typedefs because if given "typedef (B or C) test",
# we want AOrTest, not AOrBOrC
if not type.isComplete() and not isinstance(type, IDLTypedefType):
self.memberTypes[i] = type.complete(scope)
self.name = "Or".join(typeName(type) for type in self.memberTypes)
# We do this again to complete the typedef types
for (i, type) in enumerate(self.memberTypes):
if not type.isComplete():
self.memberTypes[i] = type.complete(scope)
self.flatMemberTypes = list(self.memberTypes)
i = 0
while i < len(self.flatMemberTypes):