Skip to content

Commit 92c0980

Browse files
committed
[FixCode] Make sure to accept the fixit in warning about 'where' syntax change.
1 parent c04aadb commit 92c0980

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

lib/FrontendTool/FrontendTool.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,7 @@ class JSONFixitWriter : public DiagnosticConsumer {
603603
Info.ID == diag::attr_decl_attr_now_on_type.ID ||
604604
Info.ID == diag::noescape_parameter.ID ||
605605
Info.ID == diag::noescape_autoclosure.ID ||
606+
Info.ID == diag::where_inside_brackets.ID ||
606607
Info.ID == diag::selector_construction_suggest.ID ||
607608
Info.ID == diag::selector_literal_deprecated_suggest.ID)
608609
return true;

test/FixCode/fixits-apply.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,3 +214,10 @@ func fnWithClosure(c: @escaping ()->()) {}
214214
func testescape(rec: ()->()) {
215215
fnWithClosure { rec() }
216216
}
217+
218+
protocol Prot1 {}
219+
protocol Prot2 {
220+
associatedtype Ty = Prot1
221+
}
222+
class Cls1 : Prot1 {}
223+
func testwhere<T: Prot2 where T.Ty == Cls1>(_: T) {}

test/FixCode/fixits-apply.swift.result

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,3 +217,10 @@ func fnWithClosure(c: @escaping ()->()) {}
217217
func testescape(rec: @escaping ()->()) {
218218
fnWithClosure { rec() }
219219
}
220+
221+
protocol Prot1 {}
222+
protocol Prot2 {
223+
associatedtype Ty = Prot1
224+
}
225+
class Cls1 : Prot1 {}
226+
func testwhere<T: Prot2>(_: T) where T.Ty == Cls1 {}

0 commit comments

Comments
 (0)