Tue, 10 Sep 2013 13:47:51 +0200
8005222: Fixed bugs should have tests with bugid in @bug tag
Reviewed-by: jfranck, jjg
Contributed-by: Andreas Lundblad <andreas.lundblad@oracle.com>
1 /*
2 * @test /nodynamiccopyright/
3 * @bug 8019480
4 * @summary Javac crashes when method is called on a type-variable receiver from lambda expression
5 * @author Maurizio Cimadamore
6 * @compile/fail/ref=T8019480.out -XDrawDiagnostics T8019480.java
7 */
8 import java.util.*;
10 class T8019480<U> {
11 interface Predicate<T> {
12 void m(T t);
13 }
15 interface Stream<T> {
16 void forEach(Predicate<T> pt);
17 }
19 void test(U current, Stream<U> stream) {
20 List<U> list3 = new ArrayList<>();
21 stream.forEach(i -> list3.add(current.clone()));
22 }
23 }