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
// SR-11511 Warning for inferring an array of empty tuples
64
+
vararrayOfEmptyTuples=[""].map{print($0)} // expected-warning {{variable 'arrayOfEmptyTuples' inferred to have type '[()]'}} \
65
+
// expected-note {{add an explicit type annotation to silence this warning}} {{23-23=: [()]}}
66
+
67
+
varmaybeEmpty=Optional(arrayOfEmptyTuples) // expected-warning {{variable 'maybeEmpty' inferred to have type '[()]?'}} \
68
+
// expected-note {{add an explicit type annotation to silence this warning}} {{15-15=: [()]?}}
69
+
70
+
varshouldWarnWithoutSugar=(arrayOfEmptyTuples asArray<()>) // expected-warning {{variable 'shouldWarnWithoutSugar' inferred to have type 'Array<()>'}} \
71
+
// expected-note {{add an explicit type annotation to silence this warning}} {{27-27=: Array<()>}}
72
+
63
73
classSomeClass{}
64
74
65
75
// <rdar://problem/16877304> weak let's should be rejected
0 commit comments