Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error "Failed to produce diagnostic" instead of an actionable description of a coding error. #62142

Open
fritza-ws opened this issue Nov 16, 2022 · 3 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation failed to produce diagnostic Bug → internal error: Failed to produce diagnostic for expression SwiftUI Flag: Related to (but not an issue with) SwiftUI type checker Area → compiler: Semantic analysis

Comments

@fritza-ws
Copy link

Describe the bug
Compiling the attached project yields a "Failed to produce diagnostic" instead of an informative (if any) error message.

Steps To Reproduce

  1. Unzip the attached project
  2. Open the project
  3. Command a build (Product → Build ⌘B)

Expected behavior
The build completes, either accepting the presented code or issuing an error or warning as appropriate.

Actual behavior
An error at PlanetGroupListView.swift:17, with only a message saying swiftc "failed to produce diagnostic" and soliciting this report.

Screenshots
n/a

Environment (please fill out the following information)
macOS 13.0.1 (22A400)
Xcode version 14.1 (14B47b)

31% memory pressure
305 GB available storage

Force-Quit dialog shows 13 applications open.

Additional context
After quitting Xcode and the Simulator app, and relaunching Xcode, the issue persists.

A file containing logs for the compilation stages are attached. SwiftCompile(first round) was flagged as an error but didn't show any diagnostic.

Project directory
LastChance.zip

Compile phases - log
Swift Compile Diagnostic - fritza - 16-Nov-2022.txt

@fritza-ws fritza-ws added the bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. label Nov 16, 2022
@fritza-ws
Copy link
Author

  1. Quit Xcode
  2. Delete the project Derived Data (~/Library/Developer/Xcode/DerivedData)
  3. Relaunch Xcode

Had no effect.

@xedin
Copy link
Member

xedin commented Nov 16, 2022

Just to help you out here - the problem is with \.children it's type is KeyPath<PlanetClass, [String]?> but the parameter expects [Planets]?. There is a reference to this at https://developer.apple.com/documentation/swiftui/list - "Creating hierarchical lists"

@AnthonyLatsis AnthonyLatsis added failed to produce diagnostic Bug → internal error: Failed to produce diagnostic for expression type checker Area → compiler: Semantic analysis diagnostics QoI Bug: Diagnostics Quality of Implementation compiler The Swift compiler in itself labels Nov 17, 2022
@AnthonyLatsis
Copy link
Collaborator

@fritza-ws FYI This is a fallback compiler error for when we know something is wrong but aren't able to produce a meaningful diagnostic, so this is a Swift compiler bug, not an Xcode one.

@AnthonyLatsis AnthonyLatsis added the SwiftUI Flag: Related to (but not an issue with) SwiftUI label Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation failed to produce diagnostic Bug → internal error: Failed to produce diagnostic for expression SwiftUI Flag: Related to (but not an issue with) SwiftUI type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

3 participants