Skip to content

Commit fa01895

Browse files
authored
Merge pull request #6628 from nkcsgexi/synthesized-target-check
2 parents a33aed0 + 264057d commit fa01895

File tree

4 files changed

+350
-177
lines changed

4 files changed

+350
-177
lines changed

lib/AST/ASTPrinter.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,11 +859,16 @@ class PrintAST : public ASTVisitor<PrintAST> {
859859

860860
// Get the innermost nominal type context.
861861
DeclContext *DC;
862-
if (isa<NominalTypeDecl>(Current) || isa<ExtensionDecl>(Current))
862+
if (isa<NominalTypeDecl>(Current))
863863
DC = Current->getInnermostDeclContext();
864+
else if (isa<ExtensionDecl>(Current))
865+
DC = Current->getInnermostDeclContext()->
866+
getAsNominalTypeOrNominalTypeExtensionContext();
864867
else
865868
DC = Current->getDeclContext();
866869

870+
assert(DC->isTypeContext());
871+
867872
// Get the substitutions from our base type.
868873
auto subMap = CurrentType->getContextSubstitutions(DC);
869874
auto *M = DC->getParentModule();

test/SourceKit/DocSupport/Inputs/cake.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,7 @@ public protocol P4 {}
7979

8080
extension C1 : P4 {
8181
public func C1foo() {}
82+
public struct C1S1{
83+
public func C1S1foo(a : P4) {}
84+
}
8285
}

0 commit comments

Comments
 (0)