|
1 | 1 | // Try and schedule the cancel the cancellation as fast as possible to cancel during the first pass
|
2 |
| -// RUN: not %sourcekitd-test -req=complete -pos 15:35 %s -id=complete -async -- %s == -cancel=complete 2>&1 | %FileCheck --check-prefix=CANCEL_NO_CACHE %s |
| 2 | +// RUN: not %sourcekitd-test -req=complete -pos 31:57 %s -id=complete -async -- %s == -cancel=complete 2>&1 | %FileCheck --check-prefix=CANCEL_NO_CACHE %s |
3 | 3 |
|
4 |
| -// Wait 1 second for the first pass to complete and try to cancel during the second pass. This relies on the fact that the expression in line 12 is slow to type check (rdar://80582770) |
5 |
| -// RUN: not %sourcekitd-test -req=complete -pos 15:35 %s -id=complete -async -- %s == -shell -- sleep 1 == -cancel=complete 2>&1 | %FileCheck --check-prefix=CANCEL_NO_CACHE %s |
| 4 | +// Wait 1 second for the first pass to complete and try to cancel during the second pass. This relies on the fact that the expression in line 31 is slow to type check. |
| 5 | +// RUN: not %sourcekitd-test -req=complete -pos 31:57 %s -id=complete -async -- %s == -shell -- sleep 1 == -cancel=complete 2>&1 | %FileCheck --check-prefix=CANCEL_NO_CACHE %s |
6 | 6 |
|
7 | 7 | // Built an AST inside `fast(a:)` then complete the slow operation and try to cancel it.
|
8 |
| -// RUN: not %sourcekitd-test -req=complete -pos 23:7 %s -- %s == -req=complete -pos 15:35 %s -id=complete -async -- %s == -cancel=complete 2>&1 | %FileCheck --check-prefix=CANCEL_CACHED %s |
| 8 | +// RUN: not %sourcekitd-test -req=complete -pos 39:7 %s -- %s == -req=complete -pos 31:57 %s -id=complete -async -- %s == -cancel=complete 2>&1 | %FileCheck --check-prefix=CANCEL_CACHED %s |
9 | 9 |
|
10 | 10 | // Same as above but sleep 1 second before cancelling to make sure we are actually cancelling during the second pass.
|
11 |
| -// RUN: not %sourcekitd-test -req=complete -pos 23:7 %s -- %s == -req=complete -pos 15:35 %s -id=complete -async -- %s == -shell -- sleep 1 == -cancel=complete 2>&1 | %FileCheck --check-prefix=CANCEL_CACHED %s |
| 11 | +// RUN: not %sourcekitd-test -req=complete -pos 39:7 %s -- %s == -req=complete -pos 31:57 %s -id=complete -async -- %s == -shell -- sleep 1 == -cancel=complete 2>&1 | %FileCheck --check-prefix=CANCEL_CACHED %s |
| 12 | + |
| 13 | +struct A: ExpressibleByIntegerLiteral { init(integerLiteral value: Int) {} } |
| 14 | +struct B: ExpressibleByIntegerLiteral { init(integerLiteral value: Int) {} } |
| 15 | +struct C: ExpressibleByIntegerLiteral { init(integerLiteral value: Int) {} } |
| 16 | + |
| 17 | +func + (lhs: A, rhs: B) -> A { fatalError() } |
| 18 | +func + (lhs: B, rhs: C) -> A { fatalError() } |
| 19 | +func + (lhs: C, rhs: A) -> A { fatalError() } |
| 20 | + |
| 21 | +func + (lhs: B, rhs: A) -> B { fatalError() } |
| 22 | +func + (lhs: C, rhs: B) -> B { fatalError() } |
| 23 | +func + (lhs: A, rhs: C) -> B { fatalError() } |
| 24 | + |
| 25 | +func + (lhs: C, rhs: B) -> C { fatalError() } |
| 26 | +func + (lhs: B, rhs: C) -> C { fatalError() } |
| 27 | +func + (lhs: A, rhs: A) -> C { fatalError() } |
12 | 28 |
|
13 | 29 | class Foo {
|
14 |
| - func slow(x: Invalid1, y: Invalid2) { |
15 |
| - x / y / x / y / x / y / x / y. |
| 30 | + func slow() { |
| 31 | + let x: C = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + // don't trim |
16 | 32 | }
|
17 | 33 |
|
18 | 34 | struct Foo {
|
|
0 commit comments