mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Tests] NFC: Update a couple of type-checker tests
This commit is contained in:
@@ -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 {
|
||||
@@ -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)]
|
||||
Reference in New Issue
Block a user