2015-03-02 10:41:08 +05:30
|
|
|
/* @test /nodynamiccopyright/
|
|
|
|
* @bug 8071453
|
|
|
|
* @author sadayapalam
|
|
|
|
* @summary Test that a lone private interface method cannot supply the SAM.
|
|
|
|
* @compile/fail/ref=Private06.out -XDrawDiagnostics Private06.java
|
|
|
|
*/
|
|
|
|
|
|
|
|
public class Private06 {
|
|
|
|
@FunctionalInterface
|
|
|
|
interface NAFI {
|
|
|
|
private void foo() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@FunctionalInterface
|
|
|
|
interface FI {
|
|
|
|
void foo(NAFI nafi);
|
|
|
|
}
|
|
|
|
|
2023-01-17 04:43:40 +00:00
|
|
|
public static void meth() {
|
2015-03-02 10:41:08 +05:30
|
|
|
Private06.NAFI nafi = () -> {};
|
|
|
|
Private06.FI fi = Private06.NAFI::foo; // OK.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class Private06_01 {
|
2023-01-17 04:43:40 +00:00
|
|
|
public static void meth() {
|
2015-03-02 10:41:08 +05:30
|
|
|
Private06.FI fi = Private06.NAFI::foo; // NOT OK.
|
|
|
|
}
|
|
|
|
}
|