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
Add support in the diagnostic verifier for verifying no fix-its
Checked what it would look like to verify fix-its in every case, and
currently the tests are missing expected fix-its in 435 diagnoses in 60
test files.
So as an alternative, added support for a no fix-its marker “{{none}}”, and
added that marker to the c-style for deprecation tests where it applies.
Copy file name to clipboardExpand all lines: test/Sema/diag_c_style_for.swift
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -18,19 +18,19 @@ for var d=100;d<5;d++ { // expected-warning {{C-style for statement is deprecate
18
18
19
19
// next three aren't auto-fixable
20
20
// expected-warning @+1 {{'++' is deprecated: it will be removed in Swift 3}}
21
-
for var e =3; e >4; e++{ // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}}
21
+
for var e =3; e >4; e++{ // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} {{none}}
22
22
}
23
23
24
24
// expected-warning @+1 {{'--' is deprecated: it will be removed in Swift 3}}
25
-
for var f =3; f <4; f--{ // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}}
25
+
for var f =3; f <4; f--{ // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} {{none}}
26
26
}
27
27
28
28
letstart=Int8(4)
29
29
letcount=Int8(10)
30
30
varother=Int8(2)
31
31
32
32
// expected-warning @+1 {{'++' is deprecated: it will be removed in Swift 3}}
33
-
for ; other<count; other++{ // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}}
33
+
for ; other<count; other++{ // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} {{none}}
34
34
}
35
35
36
36
// this should be fixable, and keep the type
@@ -41,15 +41,15 @@ for (var number : Int8 = start; number < count; number++) { // expected-warning
41
41
42
42
// should produce extra note
43
43
// expected-warning @+1 {{'++' is deprecated: it will be removed in Swift 3}}
44
-
for (var m: Int8 = start; m < count; ++m){ // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} expected-note {{C-style for statement can't be automatically fixed to for-in, because the loop variable is modified inside the loop}}
44
+
for (var m: Int8 = start; m < count; ++m){ // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} {{none}} expected-note {{C-style for statement can't be automatically fixed to for-in, because the loop variable is modified inside the loop}}
45
45
m +=3
46
46
}
47
47
48
48
// could theoretically fix this (and more like it if we auto-suggested "stride:")
49
-
for var o =2; o <888; o +=1{ // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}}
49
+
for var o =2; o <888; o +=1{ // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} {{none}}
50
50
}
51
51
52
52
// could theoretically fix this with "..."
53
53
// expected-warning @+1 {{'++' is deprecated: it will be removed in Swift 3}}
54
-
for var p =2; p <=8; p++{ // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}}
55
-
}
54
+
for var p =2; p <=8; p++{ // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} {{none}}
0 commit comments