Open cdietrich opened 2 years ago
The type of this is not evaluated correctly: annotations.map(Annotation::annotationType)
Giving it the proper type (by creating a local variable with the correct type) "works". Probably something with method references not working as expected.
same for explicitely passing type
private static Stream<Class<? extends Annotation>> getPermits(Class<?> clazz) {
Stream<Annotation> annotations = Arrays.stream(clazz.getAnnotations());
return annotations.<Class<? extends Annotation>>map(Annotation::annotationType).filter(a -> a.isAnnotationPresent(MyAnno.class));
}
the following code (borrowed from https://github.com/google/guice/blob/e960b66d3d5931b9cb1aebd49e452e2c489a921e/core/src/com/google/inject/spi/BindingSourceRestriction.java#L348) seems to compile in javac (tested with temurin 11) but does not compile in eclipse
cannot convert from Stream<Class<capture#2-of ? extends Annotation>> to Stream<Class<? extends Annotation>> BugTest.java