mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 00:11:26 +07:00
new inference: avoid inferring partly raw types (in case of unchecked conversion resolve to eq/low bound or null if only upper is present) as these types won't be treated as wildcard parameterized ever (IDEA-150167)
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
||||
class Test2 {
|
||||
{
|
||||
System.out.println(Optional.of(new Either())
|
||||
.map(either -> Test2.foo(either))
|
||||
.orElse("Hello"));
|
||||
Optional.of(new Either())
|
||||
.map(either -> Test2.foo(either))
|
||||
.orElse("Hello");
|
||||
|
||||
System.out.println(Optional.of(new Either())
|
||||
.map(Test2::foo)
|
||||
.orElse("Hello"));
|
||||
Optional.of(new Either())
|
||||
.map(Test2::foo)
|
||||
.orElse("Hello");
|
||||
}
|
||||
|
||||
private static <X extends Exception, A> A foo(Either<X, A> either) throws X { return null; }
|
||||
}
|
||||
|
||||
class Either<L, R> { }
|
||||
Reference in New Issue
Block a user