Skip to content

[SR-15937] ToolbarItem, failed to produce diagnostic for expression #58198

Open
@swift-ci

Description

@swift-ci
Previous ID SR-15937
Radar None
Original Reporter Paruda (JIRA User)
Type Bug
Environment

Xcode 13.2.1 (13C100) on macOS Monterey (12.2.1)

(same message on macOS Catalina with Xcode 12.4)

% swift --version
swift-driver version: 1.26.21 Apple Swift version 5.5.2 (swiftlang-1300.0.47.5 clang-1300.0.29.30)
Target: x86_64-apple-macosx12.0
% swift ContentView.swift
ContentView.swift:9:24: error: failed to produce diagnostic for expression; please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project
var body: some View {
^

Additional Detail from JIRA
Votes 0
Component/s swift
Labels Bug
Assignee None
Priority Medium

md5: 5d1bd7e157bec77f50195fc82ab529c5

Issue Description:

Attempting to compile the code below produces the message "failed to produce diagnostic for expression; please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project" (so I must obey).

import SwiftUI

struct ContentView: View  
{  
  // The message occurs next to the line below in Xcode:  
  var body: some View {  
    NavigationView {  
      List {  
        // Had a ForEach here  
      }  
      .navigationTitle("Things")  
      .toolbar {  
        EditButton()  
        // Commenting out the ToolbarItem line and its  
        // closing brace makes the message go away.  
        ToolbarItem(placement:.navigationBarLeading) {  
          Button("Add") {  
          // do nothing  
          }  
        }  
      }  
    }  
  }  
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfdiagnostics QoIBug: Diagnostics Quality of Implementationfailed to produce diagnosticBug → internal error: Failed to produce diagnostic for expressionswift 5.6type checkerArea → compiler: Semantic analysis

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions