This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Kawa build warnings
- From: Per Bothner <per at bothner dot com>
- To: Yaroslav Kavenchuk <kavenchuk at gmail dot com>
- Cc: kawa at sourceware dot org
- Date: Mon, 14 Jan 2008 23:30:01 -0800
- Subject: Re: Kawa build warnings
- References: <47888B0A.2060306@gmail.com> <47889556.2060808@gmail.com>
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/