Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions lib/AST/ASTPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1751,15 +1751,15 @@ static void printExtendedTypeName(Type ExtendedType, ASTPrinter &Printer,
PrintOptions Options) {
auto Nominal = ExtendedType->getAnyNominal();
assert(Nominal && "extension of non-nominal type");
if (auto ct = ExtendedType->getAs<ClassType>()) {
if (auto ParentType = ct->getParent()) {
ParentType.print(Printer, Options);
Printer << ".";
}
}
if (auto st = ExtendedType->getAs<StructType>()) {
if (auto ParentType = st->getParent()) {
ParentType.print(Printer, Options);
if (auto nt = ExtendedType->getAs<NominalType>()) {
if (auto ParentType = nt->getParent()) {
if (auto *PD = ParentType->getNominalOrBoundGenericNominal()) {
// Avoid using the parent type directly because it can be bound
// generic type and sugared.
PD->getDeclaredType().print(Printer, Options);
} else {
ParentType.print(Printer, Options);
}
Printer << ".";
}
}
Expand Down
4 changes: 4 additions & 0 deletions test/SourceKit/DocSupport/Inputs/cake1.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ public protocol P3 {
public extension P2 where Self : P3 {
func fooConstraint() {}
}

public extension Dictionary.Keys {
public func foo() {}
}
Loading