Generic parameter 'V' could not be inferred Xcode error Please help
Could you tell on which line the error occurs ?
Did you get this resolved? I have the same error.
In every case I've seen, this is a spurious error message caused by some syntax error buried within the view code. It can happen, for example, when you rename a function or member but still have a reference to the old name in SwiftUI code.
In the code you posted, I'd suspect that some reference to something in LoginModel is wrong.
You should file feedback with Apple on this, because it has been going on for years and wasting developers' time.
I agree with @Stokestack that it is a problem with Xcode. The usual way I debug it is by progressively commenting out sections of my code and observing at which point the compiler error disappears (or changes). This will help you narrow down and find the real syntax issue you need to fix.
I've spent 3 or 4 days working on a issue that came down to this message 'V' could not be inferred.
The problem turned out to be the compiler couldn't take the time to tell me the Transaction model did NOT have a property 'quantity' (it was changed to 'shares').
I found this out when I started factoring out pieces of the View into components... in this case when I got to creating a TransactionRow View the simplified code could be compiled and the 'quantity' property got flagged as non existent.
Wow - such a bad compiler message. Had me thinking my Query properties were bad.
Lesson I hope to learn - when things go to crap... simplify!
Swift compiler is dumb for these cases, even 3 years later. Just temporarily change the Group or ForEach into eg. VStack, and you'll see the actual problem's error message.
I was moving a large section of a View to a new (child) View and previously i had to refer to an element as self.varname -- however, now this var name was in the parent view and it caused this "generic parameter 'V'" issue. As stated, the best way to get through this is comment out sections of your view. As you do this, you'll see that you'll get more detailed (and more appropriate) errors that will help you find the issue.