mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Completion can end up calling into pre-checking multiple times in certain cases, make sure we don't attempt to fold a SequenceExpr multiple times since its original AST is in a broken state post-folding. Instead, just return the already-folded expression. rdar://133717866
18 lines
373 B
Swift
18 lines
373 B
Swift
// RUN: %batch-code-completion
|
|
|
|
// https://github.com/apple/swift/issues/75845
|
|
// Make sure we don't crash.
|
|
|
|
struct Foo {
|
|
init() {
|
|
do {
|
|
} catch {
|
|
#^A^#self#^B^# = #^C^#error#^D^#
|
|
}
|
|
}
|
|
}
|
|
// A: Decl[LocalVar]/Local: error[#any Error#]; name=error
|
|
// B: Begin completions
|
|
// C: Decl[LocalVar]/Local: error[#any Error#]; name=error
|
|
// D: Begin completions
|