Skip to content

RxScala: Update CompletenessTest.scala #1468

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

Merged
merged 1 commit into from
Jul 28, 2014

Conversation

zsxwing
Copy link
Member

@zsxwing zsxwing commented Jul 22, 2014

Cleaned up CompletenessTest.scala.

onBackpressureBuffer and onBackpressureDrop are missing in RxScala now. Wait until they are finalized in RxJava.

/cc @headinthebox, @samuelgruetter

@cloudbees-pull-request-builder

RxJava-pull-requests #1416 SUCCESS
This pull request looks good

@headinthebox
Copy link
Contributor

Thanks @zsxwing.

Would there be a way to make this code less "stringlytyped" and use reflection or something instead of manually maintaining a list of signatures.

@benjchristensen
Copy link
Member

Is this ready to merge, or is there more to do based on the last comment by @headinthebox ?

@headinthebox
Copy link
Contributor

I think you can merge; we can discuss alternatives in an issue.

@samuelgruetter
Copy link
Contributor

Would there be a way to make this code less "stringlytyped" and use reflection or something instead of manually maintaining a list of signatures.

We already use reflection to generate the defaultMethodCorrespondence, which contains all "obvious" Java->Scala mappings which can be obtained through mechanical changes such as replacing Func1[T, U] by T => U or Long, TimeUnit by Duration. The mappings in correspondenceChanges only contain deviations from the obvious default correspondence, and override the auto-generated default correspondence. I see no other solution than maintaining the correspondenceChanges list manually.

We also use reflection to check that the methods mentioned in correspondenceChanges actually exist: checkJavaMethodPresence and checkScalaMethodPresence report all mentioned methods which do not exist. So it's still "stringlytyped", but we have a "typechecker" for it ;-)

I agree that this code still looks too "stringlytyped" and that one would also want to use reflection to write down the correspondenceChanges list. I've tried this, but I abandoned it because it became very verbose and unreadable.

@samuelgruetter
Copy link
Contributor

LGTM

benjchristensen added a commit that referenced this pull request Jul 28, 2014
RxScala: Update CompletenessTest.scala
@benjchristensen benjchristensen merged commit eedeeb9 into ReactiveX:master Jul 28, 2014
@zsxwing zsxwing deleted the rxscala-completeness branch August 2, 2014 14:12
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.

5 participants