Bug 1319595, part 3 - Allow including a type twice as long as it is from the same file both times. r=billm
authorAndrew McCreight <continuation@gmail.com>
Tue, 22 Nov 2016 14:25:04 -0800
changeset 324558 d056bbc15cf86d7a5e8250bb41789ae153c274f5
parent 324557 483bea1e50921a99bec30cb16efc3a79f93c3320
child 324559 86796aaaf1f295563b6c6488cedae7ff2a92f1b7
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +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):