"failed to produce diagnostic for expression" when working with multiple overlays in SwiftUI #66454
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
expressions
Feature: expressions
failed to produce diagnostic
Bug → internal error: Failed to produce diagnostic for expression
Description
I have a program that fails to compile with the error:
Steps to reproduce
The following program is a minimal reproduction of the error:
When I try to build this program as a macOS app in Xcode 14.3.1, I get the "failed to produce diagnostic for expression" error. I get a similar error if I save this code to a file and try to compile it on the command-line:
Expected behavior
Swift gives me a descriptive error of what I've done wrong.
Environment
Swift compiler version info
Xcode version info
Deployment target: macOS 13.3
Additional context
There are lots of ways you can tweak the program and helpful diagnostics start falling out, including:
thisState.icon()
with a hard-coded iconImage(systemName: "checkmark.circle.fill")
asset.state?.color()
with a hard-coded color.green
.overlay(…)
modifiersalignment:
parameter passed to the secondoverlay
modifierAsset
struct and passing aReviewState
directly intoThumbnailImage
The text was updated successfully, but these errors were encountered: