mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-11 05:41:14 +07:00
diamonds: simulate resolved constructor with generated static factory (IDEA-195813)
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
import java.util.function.Supplier;
|
||||
|
||||
class Foo {
|
||||
private final Singleton<B> singletonB = new Singleton<>(() -> f());
|
||||
static B f() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
interface B {
|
||||
String getData();
|
||||
}
|
||||
|
||||
class Singleton<T> {
|
||||
public Singleton(Supplier<T> supplier) { }
|
||||
public Singleton(T instance) { }
|
||||
}
|
||||
Reference in New Issue
Block a user