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
let _ =([Tiger()asanyAnimal],[Panda()asanyAnimal]) // expected-error {{Performance: Ignored value uses an existential, leading to heap allocation, reference counting, and dynamic dispatch. Consider using generic constraints or concrete types instead.}}
143
+
let _ =([Tiger()asanyAnimal],[Panda()asanyAnimal]) // expected-error {{Performance: Declaration uses an existential, leading to heap allocation, reference counting, and dynamic dispatch. Consider using generic constraints or concrete types instead.}}
144
144
145
145
let(
146
146
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() {
150
150
print(type(of: animalsB))
151
151
152
152
let(
153
-
_, // expected-error {{Performance: Ignored value 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.}}
154
154
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.}}
155
155
)=([Tiger()asanyAnimal],[Panda()asanyAnimal])
156
156
157
157
print(type(of: animalsC))
158
158
159
-
let(_, _)=([Tiger()asanyAnimal],[Panda()asanyAnimal]) // expected-error 2 {{Performance: Ignored value uses an existential, leading to heap allocation, reference counting, and dynamic dispatch. Consider using generic constraints or concrete types instead.}}
159
+
let(_, _)=([Tiger()asanyAnimal],[Panda()asanyAnimal]) // 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.}}
160
160
161
161
lettuple:(animal1:anyAnimal, animal2:anyAnimal)=(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.}}
0 commit comments