You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class Dummy : RealmObject
{
public IList<Dummy> Friends { get; }
}
[Test]
public void IndexOfTest()
{
using (var realm = OpenRealm())
{
var f = new Dummy();
var d = new Dummy { Friends = { f } };
var realmList = d.Friends;
Assert.That(realmList.IndexOf(f), Is.Zero);
var realmResult = realm.All<Dummy>() as RealmCollectionBase<Dummy>;
// Assert.That(realmResult.IndexOf(f), Is.Not.Negative); // this causes infinite recursion!
}
}
This happens because RealmResult<T> implements IndexOf(object o) as:
public override int IndexOf(object value) => IndexOf((T)value);
but doesn't implement a IndexOf(T item), unlike RealmList<T> which also derive from RealmCollectionBase<T>.
The text was updated successfully, but these errors were encountered:
RealmResult<T>.IndexOf(object o)
recurses infinitely.Test case:
This happens because
RealmResult<T>
implementsIndexOf(object o)
as:but doesn't implement a
IndexOf(T item)
, unlikeRealmList<T>
which also derive fromRealmCollectionBase<T>
.The text was updated successfully, but these errors were encountered: