Open
Description
Description
The included simple code produces the "Failed to produce diagnostic for expression" error on compilation.
The issue is the extraneous '?' in the reference to action
. The compiler should be able to deal with this and highlight the actual issue.
Reproduction
import SwiftUI
struct InnerView: View {
var action: () -> Void
var body: some View {
Button("Hello", action: action?)
}
}
This code can be built in an Xcode playground, or by putting it in a file and compiling with swiftc
Expected behavior
The compiler should highlight the actual issue, which is the extraneous '?' in the reference to action
Environment
swift-driver version: 1.120.5 Apple Swift version 6.1.2 (swiftlang-6.1.2.1.2 clang-1700.0.13.5)
Target: arm64-apple-macosx15.0
Additional information
No response