Skip to content
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

[SR-15767] Failed to produce diagnostic for expression #58044

Open
swift-ci opened this issue Jan 23, 2022 · 0 comments
Open

[SR-15767] Failed to produce diagnostic for expression #58044

swift-ci opened this issue Jan 23, 2022 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. code completion Area → source tooling: code completion compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation failed to produce diagnostic Bug → internal error: Failed to produce diagnostic for expression source tooling Area: IDE support, SourceKit, and other source tooling type checker Area → compiler: Semantic analysis

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-15767
Radar None
Original Reporter AndyKlien (JIRA User)
Type Bug
Environment

I was working on a project and received this bug message while trying to compile the file.

Additional Detail from JIRA
Votes 0
Component/s CodeCompletion, Compiler
Labels Bug
Assignee None
Priority Medium

md5: 5c2bf1b01490da1eca82ab49c5eb3287

Issue Description:

I was working on a project and received this bug message while trying to compile the file.

"Failed to produce diagnostic for expression; please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project."

//

// ContentView.swift

// M29A2

//

// Created by Andy Klien on 2022-01-23.

//

import SwiftUI

struct ContentView: View {

@State **var** userText = ""

@State **var** capMode = 1



**var** body: **some** View {

    

    VStack{

        

        **if** capMode == 1

{ Text(userText.uppercased()) .font(.largeTitle) }

else if capMode == 2

{ Text(userText.capitalized()) .font(.largeTitle) }

else if capMode == 3

{ Text(userText.lowercased()) .font(.largeTitle) }

        Text(userText)

            .font(.largeTitle)

            .foregroundColor(.blue)

            .bold()

            .padding()

        

        TextField("Enter Text Here...", text: $userText)

            .padding()

            .background(.gray)

            .cornerRadius(50)

        

        HStack{

            Button(action:

{ capMode = 1 }

) {

                RoundedButton(title: "Caps", colour: .blue)

                

                Button(action:

{ capMode = 2 }

) {

                    RoundedButton(title: "First Letter", colour: .green)

                    

                    Button(action:

{ capMode = 3 }

)

{ RoundedButton(title: "Lowercase", colour: .red) }

                }

            }

            .padding()

        }

    }

}





**struct** RoundedButton: View{

    

    **var** title: String

    **var** colour: Color

    

    **var** body: **some** View

{ Text(title) .padding(10) .frame(maxWidth:.infinity) .background(colour) .font(.body) .cornerRadius(10) .foregroundColor(.white) }

}



**struct** ContentView_Previews: PreviewProvider {

    **static** **var** previews: **some** View

{ ContentView() }

}

}

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added diagnostics QoI Bug: Diagnostics Quality of Implementation failed to produce diagnostic Bug → internal error: Failed to produce diagnostic for expression type checker Area → compiler: Semantic analysis labels Dec 22, 2022
@AnthonyLatsis AnthonyLatsis added the source tooling Area: IDE support, SourceKit, and other source tooling label Feb 6, 2023
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. code completion Area → source tooling: code completion compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation failed to produce diagnostic Bug → internal error: Failed to produce diagnostic for expression source tooling Area: IDE support, SourceKit, and other source tooling type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

2 participants