Bug 1319595, part 3 - Allow including a type twice as long as it is from the same file both times. r=billm draft
authorAndrew McCreight <continuation@gmail.com>
Tue, 22 Nov 2016 14:25:04 -0800
changeset 443024 bfd3758f3f6751cef965cac260d27c54b23445f5
parent 443023 72937cb06afea4859758a716d6f95a61556679ec
child 443025 0905d6195a08d3805e10fd05b598321ee0b11038
push id36884
push userbmo:continuation@gmail.com
push dateWed, 23 Nov 2016 17:11:18 +0000
reviewersbillm
bugs1319595, 918651
milestone53.0a1
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
ipc/ipdl/ipdl/lower.py
--- 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):