Error: The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions.

Trying to figure out what is going on with this error. If you have a good idea with a missing space/character pls help me out!

import Combine
import SwiftUI

struct barHome: View {
   
  @State private var showingProgress = false
  @State private var showingCourses = false
  @State private var showingPath = false
   
  var body: some View {
    ZStack{
       
      Rectangle()
        .foregroundColor(.white)
        .frame(width: 290, height: 75)
        .cornerRadius(30)
        .shadow(color: Color.black.opacity(0.2), radius: 10, x: 10, y: 10)
        .shadow(color: Color.white.opacity(0.7), radius: 10, x: -5, y: -5)
       
    HStack{
       
      Spacer()
       
      Button(action: { showingCourses.toggle() }) {
        ZStack {
          Circle().frame(width: 50, height: 50, alignment: .trailing)
            .foregroundColor(.white)
            .shadow(color: Color.black.opacity(0.2), radius: 10, x: 10, y: 10)
            .shadow(color: Color.white.opacity(0.7), radius: 10, x: -5, y: -5)
          Image("text.book.closed").resizable().frame(width: 25, height: 25, alignment: .trailing)
            .foregroundColor(.black)
            .font(Font.title.weight(.light))
        }
      }.sheet(isPresented: $showingCourses) {
        Courses(showingCourseDetails: .constant(false), classes: mClasses)
      }
      .padding(.leading)
      .padding(.leading)
      .padding(.leading)
      .padding(.top)
      .padding(.top)
      .padding(.bottom)
       
      Spacer()
       
       
      Button(action: { showingPath.toggle() }) {
        ZStack {
          Circle().frame(width: 50, height: 50, alignment: .trailing).foregroundColor(.white)
            .shadow(color: Color.black.opacity(0.2), radius: 10, x: 10, y: 10)
            .shadow(color: Color.white.opacity(0.7), radius: 10, x: -5, y: -5)
          Image("line.horizontal.3.decrease").resizable().frame(width: 25, height: 25, alignment: .trailing)
            .foregroundColor(.black)
            .font(Font.title.weight(.light))
        }
      }.sheet(isPresented: $showingPath) {
        Path(classes: mClasses)
      }
      .padding(.top)
      .padding(.top)
      .padding(.bottom)
      .padding(.bottom)
       
      Spacer()
       
      Button(action: { showingProgress.toggle() }) {
        ZStack {
          Circle()
            .frame(width: 50, height: 50, alignment: .trailing).foregroundColor(.white)
            .shadow(color: Color.black.opacity(0.2), radius: 10, x: 10, y: 10)
            .shadow(color: Color.white.opacity(0.7), radius: 10, x: -5, y: -5)

          ZStack{
            Circle()
              .stroke(lineWidth: 5.0)
              .opacity(0.3)
              .foregroundColor(Color.gray)

            Circle()
              .trim(from: 0.0, to: CGFloat(min(0.3, 1.0)))
              .stroke(style: StrokeStyle(lineWidth: 5.0, lineCap: .square, lineJoin: .round))
              .rotationEffect(Angle(degrees: 270.0))
              .foregroundColor(Color.green)
          }.frame(width: CGFloat(30), height: CGFloat(30))
        }
      }.sheet(isPresented: $showingProgress) {
        Progress(classes: mClasses)
      }
      .padding(.trailing)
      .padding(.trailing)
      .padding(.trailing)
      .padding(.top)
      .padding(.top)
      .padding(.bottom)
      .padding(.bottom)
       
      Spacer()
      }
    }
  }
}

struct barHome_Previews: PreviewProvider {
  static var previews: some View {
    barHome()
  }
}



Which line please do you get the error ?

Maybe you should explicit CGFloat type everywhere:

Code Block
    .shadow(color: Color.black.opacity(0.2), radius: CGFloat(10), x: CGFloat(10), y: CGFloat(10))

Accepted Answer
Can you show the definitions of mClasses and Courses?
All such things may affect.


And Path and Progress, please.
Path Progress and Courses are different Views. mClass is an array of classes and the error was found on the first barHome Struct line 4
Which line is line 4 ?

Path Progress and Courses are different Views. mClass is an array of classes 

If somethings was wrong about them, an error would be shown on barHome.
Please show the definitions of them if you want to fix your issue.

Or if the SOLVED mark is not a mistake and you really have solved your issue, please share your solution.
Error: The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions.
 
 
Q