Here is my problem, distilled. This code should tell the full story:
static class Apple<K, V> {}
Apple<String, Integer> a = new Apple<String, Integer>() {};
Type[] x = ((ParameterizedType)a.getClass().getGenericSuperclass())
.getActualTypeArguments();
// x is a Type array containing String, Integer
HOWEVER, via Clojure `proxy`, I don't have a way to tell it which type
arguments to use--
(proxy [Apple [String Integer]] []) ;; something like this is not supported
Certain frameworks, however, consult these type arguments to govern their
own dynamic behavior.
Having Clojure's proxy support specifying type arguments would allow for
this not uncommon Java interop need.
On Saturday, June 22, 2019 at 5:38:36 AM UTC-5, Matching Socks wrote:
>
> By "generic type information", you mean the X in List<X> ?
>
>
> On Friday, June 21, 2019 at 12:03:46 AM UTC-4, atdixon wrote:
>>
>> However -- there are many popular Java frameworks that love to reflect on
>> their annotations and their generic type signatures.
>>
>> To name a heavyweight: Spring. But also, of late: big data frameworks,
>> many written in Java, love reflecting on generic type signatures. My org is
>> looking at Beam and Flink, for example.
>>
>
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/clojure/8c5ae6a3-2626-47ed-9439-adbab9dec469%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.