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]

Re: Kawa build warnings


Yaroslav Kavenchuk wrote:
C:\JVM\kawa\gnu\kawa\slib\srfi69.scm:33:21: warning - no accessible
method 'hashCode' in java.lang.CharSequence

When I change

> (define (string-hash (s :: <string>) #!optional (bound :: <integer> #!null))
to
> (define (string-hash (s :: <String>) #!optional (bound :: <integer> #!null))


warning disappears. What are the differences between <string> and
<String>?
> I wrote:
Hmm, <String> is <java.lang.String>, <string> is <gnu.lists.FString> - right? Why <string> is present as <java.lang.CharSequence>?

<string> is <java.lang.CharSequence> because a Scheme string can be represented as either java.lang.String (if it's a constant/immutable string) or a gnu.lists.FString (if it's a mutable string). Both do implement java.lang.CharSequence.

(This is a relatively recent change.)

<String> is a special type - it coerces any object to java.lang.String
by calling toString (and null becomes null).

Why I get warning "no accessible method 'hashCode' in java.lang.CharSequence"?

Or this warning will appear for any method call if a interface instead of a class is declared?

Yes, but I think this is a compiler error, so I just checked in a fix to so Kawa also searches java.lang.Object in this case. -- --Per Bothner per@bothner.com http://per.bothner.com/


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