|
|
|
Yeah, this is another incarnation of the same bug, and it has been fixed.
It must be the case that my fix did not get it into 5561. Last minute fix, you know...
There's a typo in the error message: "ambigous"
I've confirmed my variant persists in 5561, now in several places in my projects. I'll wait until the fix makes it into a release to either confirm or break it out to a separate issue...
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
package com.example; import java.util.*; public class A { public static class Bx<T> { public Collection<? extends String> foo(T t) { return null; } } public static interface B<T> { public Collection<? extends String> foo(T t); } public static class C implements B<String> { public StringList foo(String s) { return new StringList(); } } public static class StringList extends ArrayList<String> { } public static void main(String[] args) { new C().foo("sdf"); } }The critical point seems to be that the analyzer doesn't realize StringList satisfies Collection<? extends String> - variations not naming the ArrayList<String> as a separate class are fine.
Not as critical for me - it doesn't penetrate our code. I'll obviously check in the next release, but I'm adding it here so that you could check it yourself.