Failed to produce diagnostic for expression; please file a bug report

Received Failed to produce diagnostic for expression; please file a bug report

   var body: some View {
    VStack{
      headerView
      ScrollView(.horizontal, showsIndicators: false) {
        HStack(spacing: 10) {
          ForEach(wallet.cards.indices, id: \self) { index in Text(wallet.cards[index].cardNumber)
             
          }
        }
      }
      Spacer()
    }
  }
}

Received Failed to produce diagnostic for expression; please file a bug report

What do you want? This is not a place to write a bug report.

If you want some help to solve the issue, please show enough code and say so.
My build is failing and I don't know why. I received this error: Failed to produce diagnostic for expression; please file a bug report at var body: some View



Code Block
import SwiftUI
struct CardListView: View {
  @EnvironmentObject var wallet: Wallet
   
  var headerView: some View {
    HStack{
      Text("Overview")
        .fontWeight(.bold)
        .font(.title)
      Spacer()
      Button(action: {
        // What to perform
      }) {
        Image("add")
          .resizable()
          .frame(width: 40, height: 40)
          .padding(.trailing)
        }
      }
  }
   
  var body: some View {
    VStack {
      headerView
      ScrollView(.horizontal, showsIndicators: false) {
        HStack(spacing: 10) { ForEach(wallet.cards.indices, id: \self) { index in Text(wallet.cards[index])
           
          }
        }
      }
      Spacer()
    }
  }
struct CardListView_Previews: PreviewProvider {
  static var previews: some View {
    CardListView()
      .environmentObject(Wallet())
    }
  }
}

```


My build is failing and I don't know why. 

Swift compiler fails to output proper diagnostics when some primitive errors found in constructing views.


Please use Code block (<>) when you include codes in text.
Failed to produce diagnostic for expression; please file a bug report
 
 
Q