Realm-java: Can't use anyOf in Kotlin: Unresolved reference

Created on 7 Dec 2017  路  7Comments  路  Source: realm/realm-java

Goal

Use anyOf instead of in in my Kotlin Android app

Actual Results

I get an IDE/buildtime error:
Error:(251, 41) Unresolved reference: anyOf

Steps & Code to Reproduce

Tried to manually import, but couldn't find anyOf anywhere in the repo

Version of Realm and tooling

Realm version(s): 4.3.1

Realm sync feature enabled: no

Android Studio version: 3.0.1

O-Community T-Doc

Most helpful comment

Thanks! In that case: update the docs and blogs ;)

All 7 comments

Thanks! In that case: update the docs and blogs ;)

Only today read https://realm.io/blog/realm-4-3-0-released-w-first-class-support-for-kotlin/ and decided to upgrade and ran into this problem (better late than never).

The aforementioned article is the first Google hit for "realm kotlin" search today, March 26, 2018. So, at least blogs haven't been fixed in over 4 months!

The query predicate in() now has a Kotlin alias named anyOf() as in is a keyword in Kotlin.

anyOf doesn't work, 7.0.0 beta.

Is it imported from io.realm.kotlin.*?

@i-schuetz In my experience, Android Studio isn't the quickest to find extension methods at times. So sometimes you need to add the import yourself.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wezley98 picture wezley98  路  3Comments

gpulido picture gpulido  路  3Comments

harshvishu picture harshvishu  路  3Comments

AAChartModel picture AAChartModel  路  3Comments

mithrann picture mithrann  路  3Comments