mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
In 2eeff365b1 I forgot to copy key path component types when applying a solution to the constraint system. That caused a crash in key path code completion.
Fixes rdar://81118700 [SR-14979]
31 lines
707 B
Swift
31 lines
707 B
Swift
// RUN: %swift-ide-test --code-completion --source-filename %s -code-completion-token CC
|
|
|
|
func foo() {
|
|
let months: [[String]] = []
|
|
let abcd: Int
|
|
let x = ForEach2(months) { group in
|
|
HStack2(spacing: 3) {
|
|
useKeyPath(id: \.abcd#^CC^#)
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
struct ForEach2<Data> where Data : RandomAccessCollection {
|
|
init(_ data: Data, content: @escaping (Data.Element) -> Void) {}
|
|
}
|
|
|
|
struct Bar {
|
|
let abcd: Int
|
|
}
|
|
|
|
func useKeyPath(id: KeyPath<Bar, String>) {}
|
|
|
|
struct HStack2<Content> {
|
|
init(spacing: Double, @ViewBuilder2 content: () -> Content)
|
|
}
|
|
|
|
@resultBuilder struct ViewBuilder2 {
|
|
static func buildBlock<Content>(_ content: Content) -> Content { fatalError() }
|
|
}
|