Skip to content

Commit 37e3e32

Browse files
committed
[Tests] NFC: Adjust scope threshold for rdar://rdar31742586 test-case
The test was slow with hacks but now it's much faster - takes about 63k scopes to solve, it could be improved by introducing new overloads of prefix `-` to stdlib.
1 parent 6a4b7e7 commit 37e3e32

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

validation-test/Sema/type_checker_perf/fast/rdar31742586.swift

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// RUN: %target-typecheck-verify-swift -solver-scope-threshold=1000
2+
// REQUIRES: tools-release,no_asan
3+
4+
// The test takes about 63k scopes here due to the fact
5+
// that prefix `-` operator doesn't have an overload that
6+
// take `Int`. We could fix that in the stdlib.
7+
8+
func rdar31742586() -> Double {
9+
return -(1 + 2) + -(3 + 4) + 5 - (-(1 + 2) + -(3 + 4) + 5)
10+
// expected-error@-1 {{the compiler is unable to type-check this expression in reasonable time}}
11+
}

0 commit comments

Comments
 (0)