mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-22 06:21:25 +07:00
method refs: check cyclic inference for method refs
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
class MyTest<E> {
|
||||
MyTest(E e) {
|
||||
}
|
||||
|
||||
interface I<T> {
|
||||
MyTest<T> _(T t);
|
||||
}
|
||||
|
||||
static <Y> void bar(Y arg, I<Y> i) {
|
||||
i._(arg);
|
||||
}
|
||||
|
||||
static <Y> void bar(I<Y> i, Y arg) {
|
||||
i._(arg);
|
||||
}
|
||||
|
||||
static <Y> void bar(I<Y> i) {
|
||||
i._(null);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
I<String> i = MyTest::new;
|
||||
|
||||
bar("", MyTest<String>::new);
|
||||
bar("", MyTest::new);
|
||||
|
||||
bar(MyTest<String>::new, "");
|
||||
bar(MyTest::new, "");
|
||||
|
||||
bar(<error descr="Cyclic inference">MyTest::new</error>);
|
||||
bar(<error descr="Cyclic inference">MyTest<String>::new</error>);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user