Files
swift-mirror/validation-test/IDE/crashers_fixed/sr14979.swift
Alex Hoppen f42f961faf [Sema] Copy key path component types when merging solutions
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]
2021-07-30 11:07:21 +02:00

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() }
}