Originally created by @vovsyannikov on GitHub (Jun 26, 2024).
I have a structure in may app where I have a parent object:
openclassBaseContact:CoreStoreObject{@Field.Stored("externalId")openvarexternalId:Int?@Field.Stored("isUser")openvarisUser:Bool=false// Other props}
A child and another entity:
finalpublicclassContact:BaseContact{// Other props@Field.Relationship("userDL",inverse:\DBS.UserDL.$contact)publicvaruserDL:DBS.UserDL?// Other props}finalpublicclassUserDL:CoreStoreObject{// Other props@Field.Relationship("contact")publicvarcontact:DBS.Contact?// Other props}
When trying to fetch Contact specifically by isUser property I get an error:
There's a different error but in the same vein: Operator function '~' requires the types 'Optional<DBS.Contact>.DestinationObjectType' (aka 'DBS.Contact') and 'FieldContainer<DBS.BaseContact>.Stored<Int?>.ObjectType' (aka 'DBS.BaseContact') be equivalent
Originally created by @vovsyannikov on GitHub (Jun 26, 2024).
I have a structure in may app where I have a parent object:
```Swift
open class BaseContact: CoreStoreObject {
@Field.Stored("externalId")
open var externalId: Int?
@Field.Stored("isUser")
open var isUser: Bool = false
// Other props
}
```
A child and another entity:
```Swift
final public class Contact: BaseContact {
// Other props
@Field.Relationship("userDL", inverse: \DBS.UserDL.$contact)
public var userDL: DBS.UserDL?
// Other props
}
final public class UserDL: CoreStoreObject {
// Other props
@Field.Relationship("contact")
public var contact: DBS.Contact?
// Other props
}
```
When trying to fetch `Contact` specifically by `isUser` property I get an error:
```Swift
func contactIsUser() -> DBS.Contact? {
try? fetchOne(where: \DBS.Contact.$isUser == true)
}
```
`Binary operator '==' cannot be applied to operands of type 'KeyPath<DBS.Contact, FieldContainer<DBS.BaseContact>.Stored<Bool>>' and 'Bool'`
Same thing with:
```Swift
func currentUserDL(withContactID externalId: Int?) -> DBS.UserDL? {
try? fetchOne(where: \.$contact ~ \.$externalId == externalId)
}
```
There's a different error but in the same vein:
`Operator function '~' requires the types 'Optional<DBS.Contact>.DestinationObjectType' (aka 'DBS.Contact') and 'FieldContainer<DBS.BaseContact>.Stored<Int?>.ObjectType' (aka 'DBS.BaseContact') be equivalent`
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @vovsyannikov on GitHub (Jun 26, 2024).
I have a structure in may app where I have a parent object:
A child and another entity:
When trying to fetch
Contactspecifically byisUserproperty I get an error:Binary operator '==' cannot be applied to operands of type 'KeyPath<DBS.Contact, FieldContainer<DBS.BaseContact>.Stored<Bool>>' and 'Bool'Same thing with:
There's a different error but in the same vein:
Operator function '~' requires the types 'Optional<DBS.Contact>.DestinationObjectType' (aka 'DBS.Contact') and 'FieldContainer<DBS.BaseContact>.Stored<Int?>.ObjectType' (aka 'DBS.BaseContact') be equivalent