Skip to content

Commit c04aadb

Browse files
committed
[FixCode] Make sure to accept the fixit in note about adding '@escaping'.
1 parent b43e1e7 commit c04aadb

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

lib/FrontendTool/FrontendTool.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,8 @@ class JSONFixitWriter : public DiagnosticConsumer {
601601
Info.ID == diag::convert_let_to_var.ID ||
602602
Info.ID == diag::parameter_extraneous_double_up.ID ||
603603
Info.ID == diag::attr_decl_attr_now_on_type.ID ||
604+
Info.ID == diag::noescape_parameter.ID ||
605+
Info.ID == diag::noescape_autoclosure.ID ||
604606
Info.ID == diag::selector_construction_suggest.ID ||
605607
Info.ID == diag::selector_literal_deprecated_suggest.ID)
606608
return true;

test/FixCode/fixits-apply.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,3 +209,8 @@ class NoSemi {
209209
enum Bar { case bar }
210210
var foo: .Bar = .bar
211211
}
212+
213+
func fnWithClosure(c: @escaping ()->()) {}
214+
func testescape(rec: ()->()) {
215+
fnWithClosure { rec() }
216+
}

test/FixCode/fixits-apply.swift.result

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,3 +212,8 @@ class NoSemi {
212212
enum Bar { case bar }
213213
var foo: .Bar = .bar
214214
}
215+
216+
func fnWithClosure(c: @escaping ()->()) {}
217+
func testescape(rec: @escaping ()->()) {
218+
fnWithClosure { rec() }
219+
}

0 commit comments

Comments
 (0)