Skip to content

Bug: 'The method flatten ... is not applicable for the arguments ...' - #53

Merged
BobHanson merged 1 commit into
java2script:masterfrom
abego:ReferencePipeline_toArray_Bug
Sep 23, 2019
Merged

Bug: 'The method flatten ... is not applicable for the arguments ...'#53
BobHanson merged 1 commit into
java2script:masterfrom
abego:ReferencePipeline_toArray_Bug

Conversation

@abego

@abego abego commented Jul 21, 2018

Copy link
Copy Markdown
Contributor

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'
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.

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.
@abego
abego requested a review from BobHanson July 22, 2018 09:25
@BobHanson

BobHanson commented Jul 22, 2018 via email

Copy link
Copy Markdown
Collaborator

BobHanson added a commit that referenced this pull request Aug 16, 2018
fixing Character.toTitleCase, [Long,Integer,Short,Byte].toString(n,radix)
@BobHanson

Copy link
Copy Markdown
Collaborator

Any more on this? It's curious that it is a Java error -- nothing to do with Java2Script, right? Or what is the test case that triggers this?

@BobHanson
BobHanson merged commit ff0cda6 into java2script:master Sep 23, 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.

2 participants