Skip to content

Method call with wildcard generic parameter fails to compile #3367

Description

@alexcormier

Given a couple generic types:

class A<T> {}
class B<T> {}

And some generic methods with wildcards:

public interface Test {
   <T> B<T> b(T t);
   <T> B<A<? super T>> bOfA(B<? super T> t);
   <T> void errors(T t, B<? super T> m);

   default void test(A<String> a) {
      errors(a, bOfA(b(a)));
   }
}

This compiles with javac, but ECJ fails to compile with:

The method errors(T, B<? super T>) in the type Test is not applicable for the arguments (A<capture#1-of ?>, B<A<? super A<capture#2-of ?>>>)

This used to work fine. When we encountered #2817, we stuck to an older version until that was fixed, and then when updating after the fix we encountered this new issue. So it seems like the two issues might be related, the setup is similar too.

Metadata

Metadata

Labels

javacecj not compatible with javac

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions