Skip to content

Commit b3ad77f

Browse files
hborlaxedin
authored andcommitted
[Test] Add a few more + operands to a type checker perf test to exhibit
exponential behavior. Binding value types early allows the previous version of this test to compile, but the performance still doesn't scale with a few more operands in the + chain.
1 parent 020c29b commit b3ad77f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

validation-test/Sema/type_checker_perf/fast/rdar46713933_literal_arg.swift renamed to validation-test/Sema/type_checker_perf/slow/rdar46713933_literal_arg.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ func wrap<T: ExpressibleByFloatLiteral>(_ key: String, _ value: T) -> T { return
77
func wrap<T: ExpressibleByStringLiteral>(_ key: String, _ value: T) -> T { return value }
88

99
func wrapped() -> Int {
10-
return wrap("1", 1) + wrap("1", 1) + wrap("1", 1) + wrap("1", 1)
10+
return wrap("1", 1) + wrap("1", 1) + wrap("1", 1) + wrap("1", 1) + wrap("1", 1) + wrap("1", 1)
11+
// expected-error@-1 {{the compiler is unable to type-check this expression in reasonable time}}
1112
}

0 commit comments

Comments
 (0)