coekie/gentyref — pull request #2 by ctrueden (2014-03-31 19:35:24+00:00)
Title: Non-reifiable type resolution

First of all: thank you @coekie for creating gentyref! I was ecstatic to find this library, which fills a much needed gap in Java generics. And thank you so much for the permissive licensing, extensive suite of unit tests, clean coding style, and general awesomeness.

Now on to my gripe :wink:: I am filing this PR to solicit your feedback on a possible shortcoming of the library, which I would like to address somehow if possible. The PR is not ready to be merged as is, because 2 of the 5 unit tests it adds currently fail, to document the issue at hand.

The tests in question are `testNonreifiable` and `testTwoLayerNonreifiable` of `GetExactFieldTypeTest`. The issue is that gentyref does not resolve generics when the subtype passed to a `getExact*` method is [non-reifiable](http://docs.oracle.com/javase/tutorial/java/generics/nonReifiableVarargsType.html#non-reifiable-types). My example from the unit test: if you have a `Thing` with field `T thing`, and a `NumberThing extends Thing`, then using `NumberThing.class` to resolve the `T thing` field will return `Object.class` rather than `Number.class` as desired.

Do you think this behavior is something that could/should be changed? What would be your recommended approach for doing so? I am happy to attempt a patch, but I wanted to get your input before spending much more time on it.