Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting8/CastingCapturedWildcardToPrimitive.java
Anna Kozlova 022c5be762 java type system: use captured wildcard bounds in cast context (IDEA-233551)
starting with javac 1.9+ such code starting to compile, javac 8 rejects the code with the same language level used

GitOrigin-RevId: 87a1e4d475927af0ee71cd74f5a66e130908ed82
2020-04-16 19:41:33 +00:00

17 lines
253 B
Java

class Foo<T> {
private T _value;
T getValue() {
return _value;
}
static Foo<?> getFoo() {
return new Foo<>();
}
public static void main(String[] args) {
Foo<?> foo = getFoo();
double value = (double) foo.getValue();
}
}