Skip to content

Commit a2e5910

Browse files
authored
FixCode: when inserting protocol stubs, avoid inserting @available. rdar://32645956 (#10272)
1 parent 63a9905 commit a2e5910

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

lib/Sema/TypeCheckProtocol.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2654,6 +2654,7 @@ printRequirementStub(ValueDecl *Requirement, DeclContext *Adopter,
26542654
Options.PrintDocumentationComments = false;
26552655
Options.AccessibilityFilter = Accessibility::Private;
26562656
Options.PrintAccessibility = false;
2657+
Options.ExcludeAttrList.push_back(DAK_Available);
26572658
Options.FunctionBody = [](const ValueDecl *VD) { return getCodePlaceholder(); };
26582659
Options.setBaseType(AdopterTy);
26592660
Options.CurrentModule = Adopter->getParentModule();

test/decl/protocol/conforms/fixit_stub_editor.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// RUN: %target-typecheck-verify-swift -diagnostics-editor-mode
22

33
protocol P1 {
4+
@available(iOS, unavailable)
45
func foo1()
56
func foo2()
67
}

0 commit comments

Comments
 (0)