Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

generic inference for Collections.checkedMap #228

ribrdb opened this Issue Aug 10, 2013 · 0 comments


None yet
1 participant

ribrdb commented Aug 10, 2013

The signature for checkedMap is:
java.util.Map<K, V> checkedMap(java.util.Map<K, V>, java.lang.Class<K>, java.lang.Class<V>)

if you do Collections.checkedMap({}, Foo.class, Bar.class), the constraints are that K = Object and K = Foo, which is impossible and inference fails. Really what we should be doing here is treating {} as a raw type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment