mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only) GitOrigin-RevId: 1e1b77009dc78de49c7cc5c44d4704937397bb23
24 lines
653 B
Java
24 lines
653 B
Java
package foo;
|
|
|
|
import java.util.Optional;
|
|
class Boo {
|
|
private static class MyGenericClass<L> {
|
|
public final String field;
|
|
|
|
private MyGenericClass(String field) {
|
|
this.field = field;
|
|
}
|
|
|
|
static MyGenericClass<?> create(String field) {
|
|
return new MyGenericClass<>(field);
|
|
}
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
Optional<String> value = Optional.of("value");
|
|
MyGenericClass<Integer> myClassValue = value.map(MyGenericClass::<Integer>create).<error descr="Incompatible types. Found: 'foo.Boo.MyGenericClass<capture<?>>', required: 'foo.Boo.MyGenericClass<java.lang.Integer>'">orElse</error>(null);
|
|
}
|
|
|
|
}
|
|
|