Bug 1319595, part 3 - Allow including a type twice as long as it is from the same file both times. r=billm
This patch fixes multipleUsingCxxTypes.ipdl. This is a regression from
bug 918651.
MozReview-Commit-ID: 3ByBvp6FZUe
--- a/ipc/ipdl/ipdl/lower.py
+++ b/ipc/ipdl/ipdl/lower.py
@@ -1386,18 +1386,20 @@ class _GenerateProtocolCode(ipdl.ast.Vis
for inc in builtinHeaderIncludes:
self.visitBuiltinCxxInclude(inc)
# Compute the set of includes we need for declared structure/union
# classes for this protocol.
typesToIncludes = {}
for using in tu.using:
typestr = str(using.type.spec)
- assert typestr not in typesToIncludes
- typesToIncludes[typestr] = using.header
+ if typestr not in typesToIncludes:
+ typesToIncludes[typestr] = using.header
+ else:
+ assert typesToIncludes[typestr] == using.header
aggregateTypeIncludes = set()
for su in tu.structsAndUnions:
typedeps = _ComputeTypeDeps(su.decl.type, True)
if isinstance(su, ipdl.ast.StructDecl):
for f in su.fields:
f.ipdltype.accept(typedeps)
elif isinstance(su, ipdl.ast.UnionDecl):