If you
MyClass(Set<A> setOfA) { ... }
MyClass(Set<B> setOfB) { ... }
Erasing a type turns them into:
MyClass(Set setOfA) { ... }
MyClass(Set setOfB) { ... }
So now they are the same, and the compiler is confused.
However, if one of them was HashSet, you get the following:
MyClass(Set setOfA) { ... }
MyClass(HashSet setOfB) { ... }
And now they are different enough for the compiler to determine what to bind to at compile time.
awksp source
share