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

Added tests for optional emptiness support with Rx #308

Merged
merged 2 commits into from Apr 27, 2019

Conversation

shubhamugare
Copy link
Contributor

@shubhamugare shubhamugare commented Apr 24, 2019

• Added tests for Optional emptiness support with Rx.
• No code change was required for these tests to work.
Fixes #307

@msridhar
Copy link
Collaborator

Did we implement Rx Optional support before? I don’t remember that 🙂

@shubhamugare
Copy link
Contributor Author

Did we implement Rx Optional support before? I don’t remember that 🙂

No, these cases work without any code changes. except for the #307.

@msridhar
Copy link
Collaborator

No, these cases work without any code changes. except for the #307.

Is that because the extant Rx handling already picks up and propagates the relevant access paths on the optional parameter? If so, very cool!

@shubhamugare
Copy link
Contributor Author

Is that because the extant Rx handling already picks up and propagates the relevant access paths on the optional parameter? If so, very cool!

Yeah, optionalFoo.get() is carried from filter NS to map NS like along with other APs.

" .map(optional -> optional.get().toString());",
" observable",
" .filter(optional -> optional.isPresent() || perhaps())",
" // BUG: Diagnostic contains: returning @Nullable expression from method with @NonNull",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error message seems inappropriate, so need to make some changes in the code to have the correct error message.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments on #307 and re-add this one plus that fix (assuming it works, of course)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 👍

Copy link
Collaborator

@lazaroclapp lazaroclapp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. And we didn't even need to change the order of the handlers?

What happens if you run this with optional emptiness enabled in monorepo right now? Are there still outstanding issues preventing that switch?

@shubhamugare
Copy link
Contributor Author

shubhamugare commented Apr 25, 2019

Nice. And we didn't even need to change the order of the handlers?

Yeah.

What happens if you run this with optional emptiness enabled in monorepo right now? 'Are there still outstanding issues preventing that switch?

Yeah, I should check this now.

@lazaroclapp lazaroclapp merged commit f8d255c into uber:master Apr 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optional emptiness check gives incorrect error message in map
3 participants