method refs: accept default constructors refs for SAMs with void return type

This commit is contained in:
anna
2012-10-08 22:12:34 +02:00
parent b450cc58f9
commit f65e347410
2 changed files with 12 additions and 1 deletions

View File

@@ -33,4 +33,14 @@ class DefaultConstructor {
I2<Outer.Inner, Outer> i2 = Outer.Inner::new;
<error descr="Incompatible types. Found: '<method reference>', required: 'DefaultConstructor.I2<DefaultConstructor.Outer.Inner,java.lang.String>'">I2<Outer.Inner, String> i2str = Outer.Inner::new;</error>
}
}
}
class DefaultConstructor1 {
public void bar() {
}
{
Runnable b1 = DefaultConstructor1 :: new;
}
}