Commit 8ed1ef5
committed
Bug: 'The method flatten ... is not applicable for the arguments ...'
Eclipse 4.7.3a reports Java problem:
'The method flatten(Node<T>, IntFunction<T[]>) in the type Nodes is not
applicable for the arguments (Node, IntFunction)'
when compiling ReferencePipeline.java.
Cause
=====
It looks like the compiler cannot correctly infer the (generic) types
of the method calls in the argument list of flatten.
Solution
========
Introduce an extra temporary variable 'node' with explicit type 'Node<A>'
holding the value of the expression originally passed to flatten. This
way the correct types are used in the method call and the error message
disappears.1 parent 4c08840 commit 8ed1ef5
File tree
1 file changed
+5
-2
lines changed- sources/net.sf.j2s.java.core/src/java/util/stream
1 file changed
+5
-2
lines changedLines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
438 | | - | |
439 | | - | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
440 | 443 | | |
441 | 444 | | |
442 | 445 | | |
| |||
0 commit comments