(Swift) Failed to produce diagnostic for expression

When developing with SwiftUI, I encountered the following error:

failed to produce diagnostic for expression;
please submit a bug report (https://swift.org/contributing/#reporting-bugs)

Since I don’t understand the reason behind this error, what details should I include in the report?

It's likely you don't need to send a report because it's an issue in your code.

Show us the block of code that causes the error.

In the meantime, you can narrow it down by commenting out lines of code until the error disappears, then you'll know which bit is causing it, and we can help you.

(Swift) Failed to produce diagnostic for expression
 
 
Q