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
4 changes: 3 additions & 1 deletion lib/IDE/Refactoring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3451,7 +3451,9 @@ getDeclarationContextFromInfo(ResolvedCursorInfo Info) {
return AddEquatableContext(NomDecl);
}
} else if (auto *ExtDecl = Info.ExtTyRef) {
return AddEquatableContext(ExtDecl);
if (ExtDecl->getExtendedNominal()) {
return AddEquatableContext(ExtDecl);
}
}
return AddEquatableContext();
}
Expand Down
8 changes: 8 additions & 0 deletions test/refactoring/RefactoringKind/crashers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,11 @@ func test_42098130<T>(e1: T, e2: E_42098130) {
// RUN: %refactor -source-filename %s -pos=31:3 | %FileCheck %s -check-prefix=CHECK3
// RUN: %refactor -source-filename %s -pos=32:3 | %FileCheck %s -check-prefix=CHECK3
// CHECK3: Action begins

// SR-13000
enum Foo {}
typealias Bar = (Any, Any) -> Foo
extension /*invoke here:*/Bar {}

// RUN: %refactor --actions -source-filename %s -pos=45:27 | %FileCheck %s -check-prefix=CHECK4
// CHECK4: Action begins