SwiftUI Argument passed to call that takes no arguments

Error while calling a view and getting this error:

Argument passed to call that takes no arguments

Let’s say the error is coming at following line:

UserDetailView(user: user)

The reason for that error could be that the UserDetailView has no property defined in its View and the View is like this:

struct UserDetailView: View {
    var body: some View {

The solution is to add the property to the view so that it can be used in the constructor:

struct UserDetailView: View {
    let user: User
    
    var body: some View {
     

The Argument passed to call that takes no arguments issue should be fixed now on next build.