[Tests] NFC: Update a couple of type-checker tests

This commit is contained in:
Pavel Yaskevich
2024-10-31 14:41:45 -07:00
parent 28396a6dce
commit ff8663ff16
2 changed files with 6 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
// RUN: %scale-test --invert-result --begin 1 --end 5 --step 1 --select NumLeafScopes %s
// RUN: %scale-test --begin 1 --end 10 --step 1 --select NumLeafScopes %s
// REQUIRES: asserts,no_asan
func t(_ x: Int?) -> Int {

View File

@@ -1,4 +1,4 @@
// RUN: %target-typecheck-verify-swift -solver-expression-time-threshold=10
// RUN: %target-typecheck-verify-swift -solver-expression-time-threshold=1
// REQUIRES: no_asan
@@ -10,8 +10,11 @@ struct S {
}
}
// Note: One possible approach to this issue would be to determine when the array literal inside of the inner closure
// doesn't have any other possible bindings but Array and attempt it at that point. That would fail overload of flatMap
// that returns an optional value.
func f(x: Array<S>, y: Range<Int>) -> [S] {
return x.flatMap { z in
return x.flatMap { z in // expected-error {{the compiler is unable to type-check this expression in reasonable time}}
return ((y.lowerBound / 1)...(y.upperBound + 1) / 1).flatMap { w in
return [S(1 * Double(w) + 1.0 + z.t),
S(1 * Double(w) + 1.0 - z.t)]