emlyn / tortilla

A thin Clojure wrapper for Java APIs providing efficient and idiomatic interop.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

More specific return type hints

emlyn opened this issue · comments

When multiple overloads of a particular arity have different return types, we could look for the common superclass (or a common supertype) of all return types, instead of just hinting with Object.
If we include interfaces, then there will not necessarily be a single most specific common supertype. But in that case picking one is probably still better than just using Object. There could also be an option of a resolving function to give the user control in such situations.
There is some relevant discussion of this here and here.