For WildcardType, use Types of upper bounds (i.e. erase wildcard) #244
If I try to use JaVers to compare classes with upper-bounded wildcard types, I get an exception with message like the following:
with an instruction to:
For reasons, we cannot easily alter our model to narrow to
The error actually does not say that bounded parameters are not supported, so this pull request - treating wildcards with an upper bound as having the type of the upper bound - seems consistent with it. Certainly the tests still pass, and the behaviour is as we would expect.
In addition (and perhaps this should be the subject of another pull request), a more general change to include unbounded types (which seems like it's the same as "Try at least ") might be worth considering, though such a change would break your tests (but only the ones that expect the GENERIC_TYPE_NOT_PARAMETRIZED error).
We've only recently started using JaVers, and our usage may be fairly narrow, so it's quite possible we've missed some obvious reason why this is not a good idea, but would appreciate if you would consider it.
You are right, upper-bounded wildcard should be treated as bound type, so your Pull goes in right direction. Thanks for contributing. Could you please add test case (in
Considering your second issue about allowing unbounded wildcards, we could disqus it, but as you said, there should be separate issue/pull for this.