lambda: get info for return types from type arguments

This commit is contained in:
Anna Kozlova
2012-09-03 12:32:18 +04:00
parent e15a1b0e04
commit 8797c54ace
4 changed files with 26 additions and 1 deletions

View File

@@ -0,0 +1,16 @@
import java.util.*;
public class BugReportLambdaSquiggles<T> {
private T t;
public <V> List<V> flatMap(Mapper<T, List<V>> mapper) {
return mapper.map(t);
}
static void bar( BugReportLambdaSquiggles<Integer> x) {
x.flatMap(t1 -> new ArrayList<String>(t1));
}
interface Mapper<T, U> {
U map(T t);
}
}