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 1.14: java.io.PrintWriter prints everything as "true"


On 10/08/2013 10:56 PM, Per Bothner wrote:
The bug war introduced 2013-06-02 when fixing Savannah bug #39047
"Wrong incompatible type (boolean) with expected int".
Specifically the changes in the compare method in LangPrimType.java.
"Fixing" that method fixes your bug, but causes other issues
I'm looking at.

The underlying issue is that Scheme allows any value to
used as a boolean.  Kawa generalizes this so that any value
can be converted to boolean - which then leads to some
awkwardness with overload resolution: Which is the
"more specific method" of:

PrintWriter#println(boolean)
PrintWriter#println(Object)

They are equally general, in that any value can be converted to boolean,
and any value can be converted to Object.  I think we have this ok
when it comes to compile-time method selection (bug #39047 was partly
about fixing this), but it may be harder to get it right for run-time
method selection.  However, I will keep looking at the problem.

I have one idea for how to handle boolean in overloading. but it's
not a small change, so I need to let the idea simmer some more.
Furthermore,   I'm working on a big change involving pattern-matching,
tweaks to the way unknown functions get called, and parameter passing.
The current issue is related to this bigger change, so I think it is
best to focus on the bigger issue first.

To remind me to not forget about this issue I created a
bug report on Savannah:
https://savannah.gnu.org/bugs/index.php?40253
--
	--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]