swiftlang / swift

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

[SR-14818] Failed to produce diagnostic (SwiftUI) #57166

Open odmir opened 3 years ago

odmir commented 3 years ago
Previous ID SR-14818
Radar rdar://problem/79671444
Original Reporter @odmir
Type Bug
Environment macOS Monterey 12.0 Beta (21A5248p) Xcode 13.0 beta (13A5154h) Tested toolchains: - Default Xcode 13.0 Swift Toolchain and - Swift 5.5 Development Snapshot 2021-06-14 (a) - Swift 5.5 Development Snapshot 2021-06-23 (a)
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug, DiagnosticsQoI, TypeChecker | |Assignee | None | |Priority | Medium | md5: 3d42c213239f970ba768878df8a26fc3

Issue Description:

import SwiftUI

struct ContentView: View {
    var body: some View {
        Text("Example")
            .badge
    }
}

This snippet produces a "Failed to produce diagnostic for expression..." error. This example was reduced from the WWDC 21 Code-Along "SwiftUI on the Mac:*" series.

I've also tested with the latest development toolchain available (Swift 5.5 Development Snapshot 2021-06-14 (a)).

typesanitizer commented 3 years ago

@swift-ci create

typesanitizer commented 3 years ago

Are you saying the code in the code-along doesn't compile (and this is a reduced version of it)? Or is it that you made a change and it stopped compiling (and then you reduced it)?

odmir commented 3 years ago

I was following the code-along and noticed it failed while typing the .badge modifier (didn't finish writing the whole thing). Then I stripped everything that didn't affect the result and that is the reduced example posted here.