swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
66.77k stars 10.29k forks source link

[SR-14921] Swift Compile Error - Failed to produce diagnostic for expression #57268

Open swift-ci opened 2 years ago

swift-ci commented 2 years ago
Previous ID SR-14921
Radar None
Original Reporter mtderosier (JIRA User)
Type Bug
Environment Xcode 12.5 Compile ScrumView.swift (x86_64):
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: e3369e7a6f57efa563d8e703fb37e989

Issue Description:

// Apple Dev Tutorial
// iOS App Developer: Displaying Data in a list
// ScrumView.swift
// Scrumdinger
//
// Created by Michael Derosier on 7/14/21.
//

import SwiftUI

struct ScrumView: View {

let scrums: [DailyScrum]

var body: some View {
List {
ForEach(scrums) {
scrum in CardView(scrum: scrum) .listRowBackground(scrum.color)
}
}
}
}

struct ScrumView_Previews: PreviewProvider {

static var previews: some View {
ScrumView(scrums: DailyScrum.data)
}
}

typesanitizer commented 2 years ago

Could you please make the example self-contained? Right now, it's missing definitions for multiple types. If I add definitions for those types, I see the code compile fine.

If this is the exact code which gives you the issue, please try verifying with Xcode 13 beta, it should give you proper errors for types not being in scope.