mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-31 11:39:21 +07:00
Do not report 'unexpected wildcard' if the method reference is not in the constructor form (see JLS 15.13) GitOrigin-RevId: 19d0acbe97b2a4d6ae3f5c611ff6a24490eec09c
47 lines
1.6 KiB
Java
47 lines
1.6 KiB
Java
class Test {
|
|
interface IFactory {
|
|
Object m();
|
|
}
|
|
|
|
interface FooToInt {
|
|
int m(Foo<?> foo);
|
|
}
|
|
|
|
@interface Anno {}
|
|
|
|
enum E {}
|
|
|
|
interface I {}
|
|
|
|
static class Foo<X> { }
|
|
|
|
static abstract class ABar {
|
|
protected ABar() {
|
|
}
|
|
}
|
|
|
|
static abstract class ABaz {
|
|
}
|
|
|
|
void foo(IFactory cf) { }
|
|
|
|
void testAssign() {
|
|
IFactory c1 = <error descr="'Anno' is abstract; cannot be instantiated">Anno::new</error>;
|
|
IFactory c2 = <error descr="Enum types cannot be instantiated">E::new</error>;
|
|
IFactory c3 = <error descr="'I' is abstract; cannot be instantiated">I::new</error>;
|
|
IFactory c4 = <error descr="Unexpected wildcard">Foo<?></error>::new;
|
|
IFactory c5 = <error descr="Cannot find class 1">1</error>::new;
|
|
IFactory c6 = <error descr="'ABar' is abstract; cannot be instantiated">ABar::new</error>;
|
|
IFactory c7 = <error descr="'ABaz' is abstract; cannot be instantiated">ABaz::new</error>;
|
|
|
|
FooToInt fooToInt = Foo<?>::hashCode;
|
|
|
|
foo(<error descr="'Anno' is abstract; cannot be instantiated">Anno::new</error>);
|
|
foo(<error descr="Enum types cannot be instantiated">E::new</error>);
|
|
foo(<error descr="'I' is abstract; cannot be instantiated">I::new</error>);
|
|
foo(<error descr="Unexpected wildcard">Foo<?></error>::new);
|
|
foo(<error descr="Cannot find class 1">1</error>::new);
|
|
foo(<error descr="'ABar' is abstract; cannot be instantiated">ABar::new</error>);
|
|
foo(<error descr="'ABaz' is abstract; cannot be instantiated">ABaz::new</error>);
|
|
}
|
|
} |