You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8e2e625
Browse filesBrowse the repository at this point in the historyBrowse files
Nishith Shah
committed
[Diagnostics] Use imperative msg for protocol conformance & switch-case fixits
This commit changes fixit messages from a question/suggestion to an
imperative message for protocol conformances and switch-case. Addresses
#67510.
Copy file name to clipboardExpand all lines: test/Concurrency/async_conformance.swift
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -6,15 +6,15 @@ import Foundation
6
6
7
7
// async objc requirement, sync witness
8
8
@objcprotocolTracker{
9
-
func track(event:String)async // expected-note {{protocol requires function 'track(event:)' with type '(String) async -> ()'; do you want to add a stub?}}
9
+
func track(event:String)async // expected-note {{protocol requires function 'track(event:)' with type '(String) async -> ()'; add a stub for conformance}}
10
10
}
11
11
classDog:NSObject,Tracker{ // expected-error {{type 'Dog' does not conform to protocol 'Tracker'}}
12
12
func track(event:String){} // expected-note {{candidate is not 'async', but @objc protocol requirement is}}
13
13
}
14
14
15
15
// sync objc requirement, async witness
16
16
@objcprotocolRunner{
17
-
func run(event:String) // expected-note {{protocol requires function 'run(event:)' with type '(String) -> ()'; do you want to add a stub?}}
17
+
func run(event:String) // expected-note {{protocol requires function 'run(event:)' with type '(String) -> ()'; add a stub for conformance}}
18
18
}
19
19
classAthlete:NSObject,Runner{ // expected-error {{type 'Athlete' does not conform to protocol 'Runner'}}
20
20
func run(event:String)async{} // expected-note {{candidate is 'async', but @objc protocol requirement is not}}
@@ -33,7 +33,7 @@ class Foodie: Snacker {
33
33
34
34
// sync swift protocol, async witness
35
35
protocolBacker{
36
-
func back(stonk:String) // expected-note {{protocol requires function 'back(stonk:)' with type '(String) -> ()'; do you want to add a stub?}}
36
+
func back(stonk:String) // expected-note {{protocol requires function 'back(stonk:)' with type '(String) -> ()'; add a stub for conformance}}
37
37
}
38
38
39
39
classInvestor:Backer{ // expected-error {{type 'Investor' does not conform to protocol 'Backer'}}
Copy file name to clipboardExpand all lines: test/Concurrency/async_initializer.swift
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -148,7 +148,7 @@ struct Location {
148
148
}
149
149
150
150
protocolDefaultConstructable{
151
-
init() // expected-note {{protocol requires initializer 'init()' with type '()'; do you want to add a stub?}} {{+2:43-43=\n init() {\n <#code#>\n \}\n}}
151
+
init() // expected-note {{protocol requires initializer 'init()' with type '()'; add a stub for conformance}} {{+2:43-43=\n init() {\n <#code#>\n \}\n}}
152
152
}
153
153
extensionLocation:DefaultConstructable{} // expected-error {{type 'Location' does not conform to protocol 'DefaultConstructable'}}
0 commit comments