Good generics code marked red
Hi
The following code compiles fine with javac (and IDEA makes it fine), but the call to myMethod is marked with a red squiggle.
javac -Xlint also produces no warnings.
public class Scratch {
public void shouldCompile() {
Sample<?> sample = (Sample<?>) new Sample();
// The below line shows a red underline in IDEA 9.0.2
myMethod(sample);
}
public static class Sample<T extends Number & Comparable<T>> {
}
protected <T extends Number & Comparable<T>> Sample<T> myMethod(Sample<T> sample) {
return sample;
}
}
Please sign in to leave a comment.
Hi Ben,
Looks like a bug. Please submit corresponding ticket to IDEA tracker.