When using SwiftData
and defining a @Model
, there may be an error Missing argument for parameter #1 in call
that is rather strange.
It is caused by a property initialization that does not mention the type, e.g.:
public var dateSpec: DateSpec = .init()
It can be fixed by adding the type explicitly:
public var dateSpec: DateSpec = DateSpec.init()
I hope this helps anyone struggling with the same effect. It's rather hard to find this out, as the error message is rather unspecific.