Open bgwsolutions opened 9 months ago
In my case, the line of code which caused this error was:
Label(LocalizedStringResource("Add Item"), systemImage: "plus")
(using a LocalizedStringResource when Label already handles that - I was attempting to add , comment: "..."
to the LSR)
@bgwsolutions I recently made some changes in the area, would you mind testing with main branch snapshot from swift.org?
Description
While Coding I got the following: Failed to produce diagnostic for expression; please submit a bug report (https://swift.org/contributing/#reporting-bugs)
After debugging I found this line of code to be the cause. The issue is the missing !
Link(animal.name, destination: (URL(string: animal.link) ?? URL(string: "https://wikipedia.org")))
Code change that resolved the issue Link(animal.name, destination: (URL(string: animal.link) ?? URL(string: "https://wikipedia.org"))!)
I have XCode Version 15.2 (15C500b) I am using ios 17.2
Reproduction
Expected behavior
Should receive a compile warning
Environment
17.2
Additional information
This resolved the Link(animal.name, destination: (URL(string: animal.link) ?? URL(string: "https://wikipedia.org"))!)
The ! sign was causing the message Failed to produce diagnostic for expression; please submit a bug report (https://swift.org/contributing/#reporting-bugs)