objectbox / objectbox/objectbox-swift
There is a compilation error with Entity.id.isEqual(to:id)
Open
Nobody has claimed this yet.
bug
- Dominant language
- Swift
- Stars
- 619
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Description
Is there an existing issue?
- I have searched existing issues
Build info
- ObjectBox version: [4.1.0]
- OS: IOS 17
- Device/chipset: iPhone 15
Steps to reproduce
- my class:
// objectbox: entity
class OneEntity :{
var id: Id = 0
var text: String?
init(){}
}
query code:
func query(id: Id) -> [OneEntity] {
do {
let query: Query<OneEntity>?
query = try entityDataBox?.query {OneEntity.id.isEqual(to: id) }
.build()
if let result = try query?.find(limit: 15) {
return result
}
return []
} catch {
print("query fail, err:\(error)")
return []
}
}
I encountered a compilation error at OneEntity.id.isEqual(to: id) here:
Ambiguous use of 'isEqual(to:)'
Expected behavior
I expect OneEntity.id.isEqual(to: id) should work
Actual behavior
Compilation error
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the compilation error in the OneEntity.id.isEqual(to: id) query shown in the issue using ObjectBox 4.1.0 on iOS 17. Inspect the query expression and its available overloads, then verify that the query compiles and returns the matching OneEntity records without the ambiguous-use error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- databases, mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100