DocSupport: don't assume we've printed the first extension when merging several together. rdar://39887195

When printing the content of several extensions into a
synthesized one, we shouldn't assume the first extension in the
group always gets printed.
This commit is contained in:
Xi Ge
2018-05-02 17:44:20 -07:00
parent fc99de452d
commit 714775eb0a
3 changed files with 9 additions and 4 deletions

View File

@@ -209,6 +209,7 @@ public:
initDefaultMapToUse(D);
// If D is declared in the extension, then the synthesized target is valid.
TypeOrExtensionDecl SynthesizedTarget;
assert(D->getDeclContext()->isModuleScopeContext() == EntitiesStack.empty());
if (D->getDeclContext() == SynthesizedExtensionInfo.first)
SynthesizedTarget = SynthesizedExtensionInfo.second;
EntitiesStack.emplace_back(D, SynthesizedTarget,