Skip to content

Commit ee4d9d3

Browse files
committed
[QoI] Don't skip over protocols when importing Swift 2 type aliases
Protocols have the implicit Self generic parameter, which was preventing this type alias from getting created, so some renamed imported protocols for Swift 3 weren't emitting the expected diagnostics and fix-its. rdar://problem/26304496
1 parent da9c346 commit ee4d9d3

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/ClangImporter/ImportDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1276,7 +1276,7 @@ namespace {
12761276

12771277
// FIXME: We cannot currently handle generic types.
12781278
if (auto generic = dyn_cast<GenericTypeDecl>(typeDecl)) {
1279-
if (generic->getGenericSignature())
1279+
if (generic->getGenericSignature() && !isa<ProtocolDecl>(typeDecl))
12801280
return nullptr;
12811281
}
12821282

test/ClangModules/swift2_warnings.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,5 @@ class X : NSDocument {
9191
return url
9292
}
9393
}
94+
95+
func makeCopy<T: NSCopying>(thing: T) {} // expected-error {{'NSCopying' has been renamed to 'Copying'}} {{18-27=Copying}}

0 commit comments

Comments
 (0)