mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
The last token in a case stmt can be a string literal token, which can *contain* its interpolation segments. If one of these interpolation segments is the reference point, we'd return false from `isReferencePointInRange` because the string literal token's start location is before the interpolation token. To fix this, adjust the range we are checking to range until the end of the string interpolation token. Fixes rdar://76330416 [SR-14455]
18 lines
430 B
Swift
18 lines
430 B
Swift
// RUN: %swift-ide-test -code-completion -source-filename %s -code-completion-token=COMPLETE | %FileCheck %s
|
||
|
||
public enum Endpoint {
|
||
case movieDetail
|
||
|
||
|
||
func path() -> String {
|
||
switch self {
|
||
case .movieDetail:
|
||
let myInt: Int = 2
|
||
return "\(#^COMPLETE^#)"
|
||
}
|
||
}
|
||
}
|
||
// CHECK: Begin completions
|
||
// CHECK: Decl[LocalVar]/Local/TypeRelation[Convertible]: myInt[#Int#];
|
||
// CHECK: End completions
|