This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Strange ClassCastException
- From: Per Bothner <per at bothner dot com>
- To: Alcides Flores Pineda <alcides dot fp at gmail dot com>, Kawa Mailing List <kawa at sourceware dot org>
- Date: Sun, 21 Sep 2014 23:53:57 -0700
- Subject: Re: Strange ClassCastException
- Authentication-results: sourceware.org; auth=none
- References: <8761ghwobe dot fsf at vostro1520 dot AFP-HOME>
On 09/20/2014 10:11 PM, Alcides Flores Pineda wrote:
Here is the code just as I typed it in the REPL (and saved it in a file too):
#|kawa:1|# (define (circle-area radius) (* java.lang.Math:PI (expt radius 2)))
And I got this result/exception when calling it (or running the file
with kawa -f):
#|kawa:2|# (circle-area 3)
java.lang.ClassCastException: java.lang.Double cannot be cast to gnu.math.Numeric
I checked in a fix for this. I also checked in a testcase based on your report.
I'm also thinking about some tweaks to code-generation that avoid this problem,
but the current check-in should be ok for now.
--
--Per Bothner
per@bothner.com http://per.bothner.com/