This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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!"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]