Skip to content

Commit 3cc0b1d

Browse files
authored
[libIDE] When printing type interface, ensure we translate 'Self' to the type under printing. rdar://27306890 (#3514)
1 parent 999885f commit 3cc0b1d

File tree

3 files changed

+1179
-1178
lines changed

3 files changed

+1179
-1178
lines changed

lib/AST/ASTPrinter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ class ArchetypeSelfTransformer : public PrinterArchetypeTransformer {
157157
for (; Self->getParent(); Self = Self->getParent()) {
158158
Names.insert(Names.begin(), Self->getName());
159159
}
160-
if (!Self->getSelfProtocol() || Names.empty())
160+
if (!Self->getSelfProtocol())
161161
return tryNamedArchetypeTransform(Ty);
162162
Type Result = checkMemberType(DC, BaseTy, Names);
163163
if (Result)

test/IDE/print_type_interface.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ extension D {
7474
// TYPE4-DAG: public mutating func insert<Int>(contentsOf newElements: C, at i: Int)
7575
// TYPE4-DAG: public mutating func removeFirst(_ n: Int)
7676
// TYPE4-DAG: public mutating func replaceSubrange<Int>(_ subrange: CountableRange<Int>, with newElements: C)
77+
// TYPE4-DAG: public func makeIterator() -> IndexingIterator<Array<Int>>
7778
// TYPE4-NOT: public func joined
7879

7980
// RUN: %target-swift-ide-test -print-type-interface -usr=_TtGSaSS_ -module-name print_type_interface -source-filename %s | FileCheck %s -check-prefix=TYPE5

0 commit comments

Comments
 (0)