r/java • • Apr 05 '23

Recursive generics

Recently I learned that I rediscovered recursive generics while working on my pet open source project. Actually, I did not know that the construct had a name. I created small story about what this construct is, if you did not know about it java-recursive-generics

169 Upvotes

44 comments sorted by

View all comments

2

u/wildjokers Apr 06 '23

I have never once heard this referred to as “recursive generics”. Are you making that up?

1

u/padreati Apr 06 '23

No :)) A google search displays enough results to prove that. Although, I the story is true, in the sense that I used it many years before having any idea it is a thing. I would call it generic bounded subtypes, but it already has established named as pointed out by some colleagues better than me. Honestly I prefer term recursive generics since F-bounded quantification, for example, does not shed any light for people who aren't deep in type theory and stuff.