Skip to content
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

Method call with wildcard generic parameter fails to compile #3367

Open
alexcormier opened this issue Nov 28, 2024 · 0 comments
Open

Method call with wildcard generic parameter fails to compile #3367

alexcormier opened this issue Nov 28, 2024 · 0 comments
Assignees
Labels
javac ecj not compatible with javac

Comments

@alexcormier
Copy link

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.

@jukzi jukzi added the javac ecj not compatible with javac label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javac ecj not compatible with javac
Projects
None yet
Development

No branches or pull requests

3 participants