mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-24 09:20:53 +07:00
new inference: teach strict subtyping constraint about intersection types (IDEA-129727)
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import java.io.Serializable;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
class Test {
|
||||
static class Loader<K> {
|
||||
|
||||
static <K> Loader<K> from(Supplier<K> supplier) {
|
||||
return new Loader<>();
|
||||
}
|
||||
}
|
||||
|
||||
Loader loader = Loader.from((I<String> & Serializable) () -> "");
|
||||
|
||||
interface I<H> extends Supplier<H>{}
|
||||
}
|
||||
Reference in New Issue
Block a user