testdata for IDEA-250434

GitOrigin-RevId: 2971531084debcf848f19d970f9beec9b9f702ae
This commit is contained in:
Anna Kozlova
2021-01-21 19:29:42 +01:00
committed by intellij-monorepo-bot
parent 88739a991c
commit b5ae17aeda
2 changed files with 24 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
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");
<error descr="Incompatible types. Found: 'foo.Boo.MyGenericClass<capture<?>>', required: 'foo.Boo.MyGenericClass<java.lang.Integer>'">MyGenericClass<Integer> myClassValue = value.map(MyGenericClass::<Integer>create).orElse(null);</error>
}
}