Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

first_where false positive when using with Realm Result container #1930

Closed
abagmut opened this Issue Nov 1, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@abagmut
Copy link

abagmut commented Nov 1, 2017

// This triggers a violation:
realm?.objects(User.self).filter(NSPredicate(format: "email ==[c] %@", email)).first

@abagmut abagmut changed the title First Where Violation: Prefer using `.first(where:)` over `.filter { }.first` in collections. (first_where) first_where false positive when using with Realm collections Nov 1, 2017

@jpsim

This comment has been minimized.

Copy link
Collaborator

jpsim commented Nov 1, 2017

Can you please fill out the issue template? It's hard to understand what you're actually reporting.

@abagmut

This comment has been minimized.

Copy link
Author

abagmut commented Nov 1, 2017

// This triggers a warning:
realm?.objects(User.self).filter(NSPredicate(format: "email ==[c] %@", email)).first

@abagmut abagmut changed the title first_where false positive when using with Realm collections first_where false positive when using with Realm Result container Nov 1, 2017

@jpsim

This comment has been minimized.

Copy link
Collaborator

jpsim commented Nov 1, 2017

Ok, please update the issue template with that so this issue can be understandable for contributors who land here.

@jpsim jpsim added the bug label Nov 1, 2017

@Dschee

This comment has been minimized.

Copy link
Collaborator

Dschee commented Feb 12, 2019

@abagmut I can totally understand what this is about and this should of course be fixed. I came across this, too, when using Realm filter functions, here's another example where this triggers but shouldn't:

} else if let pauseToSplit = timeTracker.pauses.filter("beginDate < %@ AND endDate > %@", beginDate, endDate).first {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
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.