Error using toList() of Collectors

Venkat Subramaniam venkats at
Thu Jan 10 09:12:25 PST 2013

Hello everyone,

I'm trying to use the new Collectors class.

    List<Integer> numbers = Arrays.asList(1, 2, 3);

    //This works
    List<Integer> numbers1 =
    //This does not
    List<Integer> numbers2 =

     error: incompatible types: inferred type does not conform to upper bound(s)
        inferred: List<Object>
        upper bound(s): List<Integer>,Object
    1 error

Is this the expected behavior or am I missing something quite basic here?



More information about the lambda-dev mailing list