|
1 | 1 | // Tests for fix-its on `-verify` mode. |
2 | 2 |
|
3 | | -// RUN: not %target-typecheck-verify-swift 2>&1 | %FileCheck %s |
| 3 | +// RUN: not %target-typecheck-verify-swift 2>&1 | %FileCheck %s --implicit-check-not error: --implicit-check-not note: --implicit-check-not warning: |
4 | 4 |
|
5 | 5 | func labeledFunc(aa: Int, bb: Int) {} |
6 | 6 |
|
7 | 7 | func testNoneMarkerCheck() { |
| 8 | + // CHECK: [[@LINE+2]]:78: error: expected no fix-its; actual fix-it seen: {{.*}}3-16=unlabeledFunc{{.*}} |
8 | 9 | // CHECK: [[@LINE+1]]:87: error: A second {{\{\{}}none}} was found. It may only appear once in an expectation. |
9 | 10 | undefinedFunc() // expected-error {{cannot find 'undefinedFunc' in scope}} {{none}} {{none}} |
10 | 11 |
|
@@ -197,34 +198,44 @@ func test1Fixits() { |
197 | 198 | labeledFunc(aax: 0, bb: 1) // expected-error {{incorrect argument label in call (have 'aax:bb:', expected 'aa:bb:')}} {{15-18=xx}} {{15-18=aa}} {{none}} |
198 | 199 |
|
199 | 200 | // CHECK-NOT: [[@LINE+1]]:{{[0-9]+}}: error: |
200 | | - labeledFunc(aax: 0, bb: 1) // expected-error {{incorrect argument label in call (have 'aax:bb:', expected 'aa:bb:')}} {{200:15-200:18=aa}} |
| 201 | + labeledFunc(aax: 0, bb: 1) // expected-error {{incorrect argument label in call (have 'aax:bb:', expected 'aa:bb:')}} {{201:15-201:18=aa}} |
201 | 202 | // CHECK-NOT: [[@LINE+1]]:{{[0-9]+}}: error: |
202 | | - labeledFunc(aax: 0, bb: 1) // expected-error {{incorrect argument label in call (have 'aax:bb:', expected 'aa:bb:')}} {{202:15-18=aa}} |
| 203 | + labeledFunc(aax: 0, bb: 1) // expected-error {{incorrect argument label in call (have 'aax:bb:', expected 'aa:bb:')}} {{203:15-18=aa}} |
203 | 204 | // CHECK-NOT: [[@LINE+1]]:{{[0-9]+}}: error: |
204 | | - labeledFunc(aax: 0, bb: 1) // expected-error {{incorrect argument label in call (have 'aax:bb:', expected 'aa:bb:')}} {{15-204:18=aa}} |
| 205 | + labeledFunc(aax: 0, bb: 1) // expected-error {{incorrect argument label in call (have 'aax:bb:', expected 'aa:bb:')}} {{15-205:18=aa}} |
205 | 206 | // CHECK-NOT: [[@LINE+1]]:{{[0-9]+}}: error: |
206 | 207 | labeledFunc(aax: 0, bb: 1) // expected-error {{incorrect argument label in call (have 'aax:bb:', expected 'aa:bb:')}} {{-0:15-+0:18=aa}} |
207 | 208 | // CHECK-NOT: [[@LINE+1]]:{{[0-9]+}}: error: |
208 | 209 | labeledFunc(aax: 0, bb: 1) // expected-error {{incorrect argument label in call (have 'aax:bb:', expected 'aa:bb:')}} {{15--0:18=aa}} |
209 | 210 | // CHECK-NOT: [[@LINE+1]]:{{[0-9]+}}: error: |
210 | | - labeledFunc(aax: 0, bb: 1) // expected-error {{incorrect argument label in call (have 'aax:bb:', expected 'aa:bb:')}} {+0:15-210:18=aa}} |
| 211 | + labeledFunc(aax: 0, bb: 1) // expected-error {{incorrect argument label in call (have 'aax:bb:', expected 'aa:bb:')}} {+0:15-211:18=aa}} |
211 | 212 | // CHECK-NOT: [[@LINE+1]]:{{[0-9]+}}: error: |
212 | 213 | labeledFunc(aa: 0, // expected-error {{incorrect argument label in call (have 'aa:bbx:', expected 'aa:bb:')}} {{+1:15-+1:18=bb}} |
213 | 214 | bbx: 1) |
214 | 215 | // CHECK-NOT: [[@LINE+1]]:{{[0-9]+}}: error: |
215 | | - labeledFunc(aa: 0, // expected-error {{incorrect argument label in call (have 'aa:bbx:', expected 'aa:bb:')}} {{216:15-+1:18=bb}} |
| 216 | + labeledFunc(aa: 0, // expected-error {{incorrect argument label in call (have 'aa:bbx:', expected 'aa:bb:')}} {{217:15-+1:18=bb}} |
216 | 217 | bbx: 1) |
217 | 218 |
|
218 | 219 | // CHECK: [[@LINE+1]]:121: error: expected fix-it not seen; actual fix-it seen: {{\{\{}}15-18=aa}} |
219 | | - labeledFunc(aax: 0, bb: 1) // expected-error {{incorrect argument label in call (have 'aax:bb:', expected 'aa:bb:')}} {{61:15-18=aa}} |
| 220 | + labeledFunc(aax: 0, bb: 1) // expected-error {{incorrect argument label in call (have 'aax:bb:', expected 'aa:bb:')}} {{62:15-18=aa}} |
220 | 221 | // CHECK: [[@LINE+1]]:121: error: expected fix-it not seen; actual fix-it seen: {{\{\{}}15-18=aa}} |
221 | 222 | labeledFunc(aax: 0, bb: 1) // expected-error {{incorrect argument label in call (have 'aax:bb:', expected 'aa:bb:')}} {{-1:15-18=aa}} |
222 | 223 | // CHECK: [[@LINE+1]]:121: error: expected fix-it not seen; actual fix-it seen: {{\{\{}}15-18=aa}} |
223 | 224 | labeledFunc(aax: 0, bb: 1) // expected-error {{incorrect argument label in call (have 'aax:bb:', expected 'aa:bb:')}} {{+0:15--1:18=aa}} |
224 | 225 | // CHECK: [[@LINE+1]]:121: error: expected fix-it not seen; actual fix-it seen: {{\{\{}}15-18=aa}} |
225 | | - labeledFunc(aax: 0, bb: 1) // expected-error {{incorrect argument label in call (have 'aax:bb:', expected 'aa:bb:')}} {{61:15-+1:18=aa}} |
| 226 | + labeledFunc(aax: 0, bb: 1) // expected-error {{incorrect argument label in call (have 'aax:bb:', expected 'aa:bb:')}} {{62:15-+1:18=aa}} |
226 | 227 | } |
227 | 228 |
|
| 229 | +// CHECK: [[@LINE+10]]:6: error: unexpected note produced: 'unlabeledFunc' declared here |
| 230 | +// CHECK: [[@LINE+9]]:6: error: unexpected note produced: 'unlabeledFunc' declared here |
| 231 | +// CHECK: [[@LINE+8]]:6: error: unexpected note produced: 'unlabeledFunc' declared here |
| 232 | +// CHECK: [[@LINE+7]]:6: error: unexpected note produced: 'unlabeledFunc' declared here |
| 233 | +// CHECK: [[@LINE+6]]:6: error: unexpected note produced: 'unlabeledFunc' declared here |
| 234 | +// CHECK: [[@LINE+5]]:6: error: unexpected note produced: 'unlabeledFunc' declared here |
| 235 | +// CHECK: [[@LINE+4]]:6: error: unexpected note produced: 'unlabeledFunc' declared here |
| 236 | +// CHECK: [[@LINE+3]]:6: error: unexpected note produced: 'unlabeledFunc' declared here |
| 237 | +// CHECK: [[@LINE+2]]:6: error: unexpected note produced: 'unlabeledFunc' declared here |
| 238 | +// CHECK: [[@LINE+1]]:6: error: unexpected note produced: 'unlabeledFunc' declared here |
228 | 239 | func unlabeledFunc(_ aa: Int) {} |
229 | 240 |
|
230 | 241 | func testDefaultedLineNumbers() { |
|
0 commit comments