Skip to content

Commit 68fc686

Browse files
authored
Merge pull request #4267 from akyrtzi/warn_unused_result-accept-fixit
[FixCode] Accept the fixit for the warning that @warn_unused_result is the default now.
2 parents c1ce5a5 + 0cd8ca5 commit 68fc686

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

lib/FrontendTool/FrontendTool.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,7 @@ class JSONFixitWriter : public DiagnosticConsumer {
636636
Info.ID == diag::selector_literal_deprecated_suggest.ID ||
637637
Info.ID == diag::attr_noescape_deprecated.ID ||
638638
Info.ID == diag::attr_autoclosure_escaping_deprecated.ID ||
639+
Info.ID == diag::attr_warn_unused_result_removed.ID ||
639640
Info.ID == diag::any_as_anyobject_fixit.ID ||
640641
Info.ID == diag::deprecated_protocol_composition.ID ||
641642
Info.ID == diag::deprecated_protocol_composition_single.ID ||

test/FixCode/fixits-apply.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ func testescape(rec: ()->()) {
233233
fnWithClosure { rec() }
234234
}
235235

236+
@warn_unused_result func testDeprecatedAttr() -> Int { return 0 }
237+
236238
protocol Prot1 {}
237239
protocol Prot2 {
238240
associatedtype Ty = Prot1

test/FixCode/fixits-apply.swift.result

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,8 @@ func testescape(rec: @escaping ()->()) {
236236
fnWithClosure { rec() }
237237
}
238238

239+
func testDeprecatedAttr() -> Int { return 0 }
240+
239241
protocol Prot1 {}
240242
protocol Prot2 {
241243
associatedtype Ty = Prot1

0 commit comments

Comments
 (0)