This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
function parameters with generic types
- From: "Hurst, Dave" <DHurst at lisletech dot com>
- To: "'kawa at sources dot redhat dot com'" <kawa at sources dot redhat dot com>
- Date: Tue, 18 Jul 2006 17:10:26 -0500
- Subject: function parameters with generic types
I have a Java class that has an overloaded method. The two methods are
distinguished by the argument types.
class PolicyFilter {
public List<PolicyNode> filter(PolicyNode p);
public List<PolicyNode> filter(List<PolicyNode> p);
}
When I call one of these methods from Kawa, I get an error complaining that
there is "no definitely applicable method 'filter' in PolicyFilter." So I
defined a utility function that specifies the type of its arguments.
(define (filter-policy policy :: <java.util.List>)
(PolicyFilter:filter policy)
... )
Unfortunately, it seems that specifying the List type to Kawa is not enough
for it to determine which method is the correct one to use. The above code
still results in the "no definitely applicable method" error message. Is
there a way to specify the generic type to Kawa so that it can determine
which method is the correct one? Or do I need to distinguish the function
in some other way (i.e. change the name)?
--DaveH "Be Excellent to each other!"