title: Type '()' cannot conform to 'View' - SwiftUI
body: <p>I recently started a beginner project and I have this annoying error. Basically I want to loop trough some tasks, take every progress and sum it.</p>
  <pre><code> import Foundation
      import SwiftUI
      
      class sums: ObservableObject{
          @Published var sum: Double = 0
          @EnvironmentObject var listViewModel: ListViewModel
          
          func sums2()-&gt;Double{
              ForEach(listViewModel.items){item in
                  sum += item.test
              }
              return sum
          }
      }
  </code></pre>