The compiler failed to produce diagnostic for method TestCrashView_Previews.previews. In this case the parameter should be "add: Entry.init" instead of "add: Value.init"
struct Value: Identifiable, Codable {
var id: Int = 0
}
struct TestCrashView<V>: View where V : RandomAccessCollection, V.Element: Identifiable {
@Binding var value: V
let add: () -> V.Element
var body: some View {
Text("...")
}
}
struct TestCrashView_Previews: PreviewProvider {
struct Entry: Identifiable {
var id: Int = 1
}
static var previews: some View {
let values: [Entry] = []
TestCrashView(value: .constant(values), add: Value.init)
}
}
Attachment: Download
Environment
Xcode Version 13.1 (13A1030d)Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: b2b79469062bc0afa91f4a70485dd729Issue Description:
The compiler failed to produce diagnostic for method TestCrashView_Previews.previews. In this case the parameter should be "add: Entry.init" instead of "add: Value.init"