mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Fix a crash that could occur when performing completion at the start of an accessor body. Previously we assumed `CodeCompletion` would never be null due to function body skipping in the first pass of code completion. However with the introduction of the ability to avoid skipping in certain cases, it might be now be null if we need to avoid skipping. Found by the stress tester. rdar://95772803
15 lines
505 B
Swift
15 lines
505 B
Swift
|
|
var foo: Double { 1 / 2 }
|
|
var bar: Regex<Substring> { /x/ }
|
|
var baz: Regex<Substring> { / x/ }
|
|
var qux: Regex<Substring> { / x}/ }
|
|
|
|
// Check that we are not crashing
|
|
// RUN: %sourcekitd-test \
|
|
// RUN: -req=complete -pos=2:18 %s -- -enable-bare-slash-regex %s == \
|
|
// RUN: -req=complete -pos=3:28 %s -- -enable-bare-slash-regex %s == \
|
|
// RUN: -req=complete -pos=4:28 %s -- -enable-bare-slash-regex %s == \
|
|
// RUN: -req=complete -pos=5:28 %s -- -enable-bare-slash-regex %s
|
|
|
|
// REQUIRES: swift_in_compiler
|