mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This was causing an exponential amount of time traversing the AST with deeply chained protocol extension methods, such as in the TestCodableRouter.swift test in Kitura. If the OpaqueValueExpr is referenced more than once within the OpenExistentialExpr it'll still get visited more than once, but that doesn't seem to happen in practice. If it turns out to be a problem, we can weaken the assertion I'm adding here. https://bugs.swift.org/browse/SR-11012
18 lines
315 B
Plaintext
18 lines
315 B
Plaintext
// RUN: %scale-test --begin 1 --end 5 --step 1 --select VarDeclUsageCheckerExprVisits %s
|
|
// REQUIRES: OS=macosx
|
|
// REQUIRES: asserts
|
|
|
|
protocol Proto {}
|
|
extension Proto {
|
|
var selfish: Proto { return self }
|
|
}
|
|
|
|
struct X: Proto {}
|
|
|
|
func test(_ x: X) -> Proto {
|
|
return x
|
|
%for i in range(0, N*5):
|
|
.selfish
|
|
%end
|
|
}
|