mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
methods refs: check if default constructor is acceptable
This commit is contained in:
@@ -44,3 +44,15 @@ class DefaultConstructor1 {
|
||||
Runnable b1 = DefaultConstructor1 :: new;
|
||||
}
|
||||
}
|
||||
|
||||
class DefaultConstructor2 {
|
||||
interface I {
|
||||
void foo(DefaultConstructor2 e);
|
||||
}
|
||||
|
||||
|
||||
void f() {
|
||||
<error descr="Incompatible types. Found: '<method reference>', required: 'DefaultConstructor2.I'">I i1 = DefaultConstructor2 :: new;</error>
|
||||
<error descr="Incompatible types. Found: '<method reference>', required: 'DefaultConstructor2.I'">I i2 = this::new;</error>
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user