Created
November 16, 2016 02:50
-
-
Save aeisenberg/de558a35d09de0184be2707cfe42c921 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Collection; | |
public class Ambiguity { | |
public void foo(CriteriaBuilder builder) { | |
// change Object -> Number (or any other type) and it compiles | |
Expression<Object> objectExpression = null; | |
Expression<Collection<Object>> collectionOfObjectExpression = null; | |
builder.isNotMember(objectExpression, collectionOfObjectExpression); | |
} | |
} | |
class Expression<T> { } | |
class CriteriaBuilder { | |
public <E,C extends Collection<E>> void isNotMember(E elem, Expression<C> collection) {} | |
public <E,C extends Collection<E>> void isNotMember(Expression<E> elem, Expression<C> collection) {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@otrosien has a workaround in the other gist I created: https://gist.github.com/olivergierke/c644327bb89191f2b52e298427ebf201