test/tools/javac/lambda/8023558/T8023558a.java

changeset 2043
571f8ebc2d51
parent 2025
3ae1814f7c59
child 2525
2eb010b6cb22
equal deleted inserted replaced
2042:41599b57d262 2043:571f8ebc2d51
29 public class T8023558a { 29 public class T8023558a {
30 interface SAM<T> { 30 interface SAM<T> {
31 T get(); 31 T get();
32 } 32 }
33 33
34 static class K<T> implements SAM<T> {
35 public T get() {
36 return (T)this;
37 }
38 }
39
34 public static void main(String[] args) { 40 public static void main(String[] args) {
35 SAM<SAM> sam = new SAM<SAM>() { public SAM get() { return null; } }; 41 SAM<SAM> sam = new SAM<SAM>() { public SAM get() { return new K<>(); } };
36 SAM temp = sam.get()::get; 42 SAM temp = sam.get()::get;
37 } 43 }
38 } 44 }

mercurial