Skip to content

3.x: Fix type inference problem when compiling with newer JDKs #6682

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
Oct 18, 2019

Conversation

akarnokd
Copy link
Member

@akarnokd akarnokd commented Oct 18, 2019

Code in the FlowableGroupByTest didn't compile on newer JDKs because of type inference changes between Java 6 and them. In Java 6, this

Flowable<Integer> source = ...
Flowable<X> result = source.groupBy(Functions.identity());

comes out as X == GroupedFlowable<Object, Integer>. However, newer JDKs will propagate type arguments thus:

Flowable<Integer> source = ...
Flowable<Y> result = source.groupBy(Functions.identity());

Y == GroupedFlowable<Integer, Integer> and mismatching with the rest of the types.

I chose an explicit Integer argument for clarity.

@akarnokd akarnokd added this to the 3.0 milestone Oct 18, 2019
@codecov
Copy link

codecov bot commented Oct 18, 2019

Codecov Report

Merging #6682 into 3.x will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##                3.x    #6682      +/-   ##
============================================
+ Coverage     98.12%   98.14%   +0.02%     
- Complexity     6187     6188       +1     
============================================
  Files           677      677              
  Lines         44657    44657              
  Branches       6170     6170              
============================================
+ Hits          43819    43828       +9     
+ Misses          300      294       -6     
+ Partials        538      535       -3
Impacted Files Coverage Δ Complexity Δ
...ernal/operators/flowable/FlowableFlatMapMaybe.java 93.22% <0%> (-3.13%) 2% <0%> (ø)
...l/operators/observable/ObservableFlatMapMaybe.java 92.25% <0%> (-2.12%) 2% <0%> (ø)
...internal/operators/flowable/FlowableSwitchMap.java 94.39% <0%> (-1.41%) 3% <0%> (ø)
...ctivex/rxjava3/internal/util/QueueDrainHelper.java 98.61% <0%> (-1.39%) 57% <0%> (-1%)
...perators/observable/ObservableMergeWithSingle.java 99.05% <0%> (-0.95%) 2% <0%> (ø)
...operators/observable/ObservableMergeWithMaybe.java 99.09% <0%> (-0.91%) 2% <0%> (ø)
...nternal/operators/observable/ObservableCreate.java 96.58% <0%> (-0.86%) 2% <0%> (ø)
...va3/internal/operators/flowable/FlowableCache.java 97.72% <0%> (-0.76%) 37% <0%> (-1%)
...3/internal/operators/flowable/FlowableGroupBy.java 95.75% <0%> (-0.54%) 3% <0%> (ø)
...a3/internal/operators/flowable/FlowableCreate.java 97.08% <0%> (-0.33%) 6% <0%> (ø)
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c1a919c...3703d1a. Read the comment docs.

@akarnokd akarnokd merged commit 118f405 into ReactiveX:3.x Oct 18, 2019
@akarnokd akarnokd deleted the FixInferenceAnomaly3x branch October 18, 2019 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants