Skip to content

There is a compilation error with Entity.id.isEqual(to:id) #90

Description

@welkinbai

Is there an existing issue?

Build info

  • ObjectBox version: [4.1.0]
  • OS: IOS 17
  • Device/chipset: iPhone 15

Steps to reproduce

  1. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions