8000 Failed to produce diagnostic for expression with misplaced '?' · Issue #81710 · swiftlang/swift · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Failed to produce diagnostic for expression with misplaced '?' #81710

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

Open
Zim999 opened this issue May 22, 2025 · 0 comments
Open

Failed to produce diagnostic for expression with misplaced '?' #81710

Zim999 opened this issue May 22, 2025 · 0 comments
84F4
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels

Comments

@Zim999
Copy link
Zim999 commented May 22, 2025

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

@Zim999 Zim999 added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels labels May 22, 2025
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. triage needed This issue needs more specific labels
Projects
None yet
Development

No branches or pull requests

1 participant
0