Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generic inference for Collections.checkedMap #228

Open
ribrdb opened this issue Aug 10, 2013 · 0 comments
Open

generic inference for Collections.checkedMap #228

ribrdb opened this issue Aug 10, 2013 · 0 comments

Comments

@ribrdb
Copy link
Contributor

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant