This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: kawa 1.14: java.io.PrintWriter prints everything as "true"
- From: Per Bothner <per at bothner dot com>
- To: Ito Kazumitsu <kaz at maczuka dot gcd dot org>
- Cc: kawa at sourceware dot org
- Date: Sun, 13 Oct 2013 00:03:06 -0700
- Subject: Re: kawa 1.14: java.io.PrintWriter prints everything as "true"
- Authentication-results: sourceware.org; auth=none
- References: <20131008 dot 131857 dot 433844808 dot kaz at maczuka dot gcd dot org> <5253AEAA dot 6030605 at bothner dot com> <20131009 dot 105106 dot 389956539 dot kaz at maczuka dot gcd dot org> <5254F014 dot 4080203 at bothner dot com>
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/