-
Notifications
You must be signed in to change notification settings - Fork 869
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
add TypeInfo
to preserve more type information
#1849
base: master
Are you sure you want to change the base?
Conversation
… the same class as the one provided by Java
it's not likely to happen, but always be cautious
Nice to see progress in this area. BTW: There is still an old PR from me #827 which might do the same. I only took a short look at your PR (and noticed, there are no tests, yet), so I cannot say, how similar they are. |
Yes, the final purpose of this PR and #827 are the same: introduce Java Generic support. But I decided to use
And about tests, I'm working on a test for And a question, my expectation is that there will be 3 parts (so 3 PRs) for Java Generic support:
Should I combine them into one large PR or split into 3? |
This PR added "TypeInfo" as another representation of Java type, in an effort to preserve more type information than what a
Class<?>
can provide, especially information on type variable and parameterized typeTypeInfo#asClass()
, in other words, this method should and will return the class represented by this type after Java erased its generic type info.Object.class
if not explecitly declared boundTypeInfo#getTypeTag()
andTypeInfo#isObject()
TypeInfo#consolidate(...)
, which is reserved for implementing Java Generics support, you can find an example implementation at Java Generics support KubeJS-Mods/Rhino#55