Skip to content

Commit 75c1fad

Browse files
committed
Enforce consistent capitalization in diagnostic messages
1 parent d0ebe90 commit 75c1fad

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8962,7 +8962,7 @@ GROUPED_WARNING(perf_hint_var_uses_existential,ExistentialType,DefaultIgnore,
89628962
"and dynamic dispatch. Consider using generic constraints or concrete types instead.",
89638963
(const VarDecl *))
89648964
GROUPED_WARNING(perf_hint_any_pattern_uses_existential,ExistentialType,DefaultIgnore,
8965-
"Performance: Declaration uses an existential, leading to heap allocation, reference counting, "
8965+
"Performance: declaration uses an existential, leading to heap allocation, reference counting, "
89668966
"and dynamic dispatch. Consider using generic constraints or concrete types instead.",
89678967
())
89688968
GROUPED_WARNING(perf_hint_typealias_uses_existential,ExistentialType,DefaultIgnore,

test/PerformanceHints/existential-any.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func testCompoundTypes() {
140140
// Tuple
141141
////////////////////////////////////////////////////////////////////////////////
142142
func tupleTest() {
143-
let _ = ([Tiger() as any Animal], [Panda() as any Animal]) // expected-error {{Performance: Declaration uses an existential, leading to heap allocation, reference counting, and dynamic dispatch. Consider using generic constraints or concrete types instead.}}
143+
let _ = ([Tiger() as any Animal], [Panda() as any Animal]) // expected-error {{Performance: declaration uses an existential, leading to heap allocation, reference counting, and dynamic dispatch. Consider using generic constraints or concrete types instead.}}
144144

145145
let (
146146
animalsA, // expected-error {{Performance: 'animalsA' uses an existential, leading to heap allocation, reference counting, and dynamic dispatch. Consider using generic constraints or concrete types instead.}}
@@ -150,13 +150,13 @@ func tupleTest() {
150150
print(type(of: animalsB))
151151

152152
let (
153-
_, // expected-error {{Performance: Declaration uses an existential, leading to heap allocation, reference counting, and dynamic dispatch. Consider using generic constraints or concrete types instead.}}
153+
_, // expected-error {{Performance: declaration uses an existential, leading to heap allocation, reference counting, and dynamic dispatch. Consider using generic constraints or concrete types instead.}}
154154
animalsC // expected-error {{Performance: 'animalsC' uses an existential, leading to heap allocation, reference counting, and dynamic dispatch. Consider using generic constraints or concrete types instead.}}
155155
) = ([Tiger() as any Animal], [Panda() as any Animal])
156156

157157
print(type(of: animalsC))
158158

159-
let (_, _) = ([Tiger() as any Animal], [Panda() as any Animal]) // expected-error 2 {{Performance: Declaration uses an existential, leading to heap allocation, reference counting, and dynamic dispatch. Consider using generic constraints or concrete types instead.}}
159+
let (_, _) = ([Tiger() as any Animal], [Panda() as any Animal]) // expected-error 2 {{Performance: declaration uses an existential, leading to heap allocation, reference counting, and dynamic dispatch. Consider using generic constraints or concrete types instead.}}
160160

161161
let tuple: (animal1: any Animal, animal2: any Animal) = (Tiger(), Panda()) // expected-error {{Performance: 'tuple' uses an existential, leading to heap allocation, reference counting, and dynamic dispatch. Consider using generic constraints or concrete types instead.}}
162162
print(type(of: tuple))

0 commit comments

Comments
 (0)