public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Per Bothner <per@bothner.com>
To: Vasantha Ganesh <vasanthaganesh.k@gmail.com>, kawa@sourceware.org
Subject: Re: Help, writing kawa equivalent of java program
Date: Sat, 01 Apr 2017 16:28:00 -0000	[thread overview]
Message-ID: <58919df1-afe7-ae3b-0fdc-bb428c8ba3ed@bothner.com> (raw)
In-Reply-To: <CAL0TjKqhgjp75FtHe8JComoSX+qMBoB7H4L1apBpVYRQ3Ys_zg@mail.gmail.com>

On 04/01/2017 08:54 AM, Vasantha Ganesh wrote:
>
> and this Kawa program:
>
> (define-simple-class kittens ()
>   (make-interface #t)
>   (a::long))
>
> (display kittens:class)
>
> I think both are equivalent, but kawa seems to think that I'm doing a
> type cast and throws this error message:
>
> Argument #1 'class kittens' to 'gnu.bytecode.Type.getReflectClass()'
> has wrong type (class) (java.lang.Class cannot be cast to
> gnu.bytecode.Type)
>     at not_working.run(not_working.scm:5)
>     at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:317)
>     at gnu.expr.CompiledModule.evalModule(CompiledModule.java:42)
>     at gnu.expr.CompiledModule.evalModule(CompiledModule.java:61)
>     at kawa.Shell.runFile(Shell.java:538)
>     at kawa.Shell.runFileOrClass(Shell.java:447)
>     at kawa.repl.main(repl.java:881)
> Caused by: java.lang.ClassCastException: java.lang.Class cannot be
> cast to gnu.bytecode.Type
>     ... 7 more

That looks like a bug.  I'll take a look.

It does work if you use the -f flag:

kawa -f /tmp/not_working.scm
class kittens
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/

  reply	other threads:[~2017-04-01 16:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-01 15:54 Vasantha Ganesh
2017-04-01 16:28 ` Per Bothner [this message]
2017-04-01 19:44   ` Vasantha Ganesh
2017-04-01 19:52     ` Per Bothner
2017-04-01 19:59       ` Vasantha Ganesh
2017-04-01 20:00         ` Vasantha Ganesh
2017-04-01 20:20           ` Sudarshan S Chawathe
2017-04-01 20:25             ` Per Bothner
2017-04-01 20:51               ` Vasantha Ganesh
2017-04-02  5:39   ` Per Bothner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58919df1-afe7-ae3b-0fdc-bb428c8ba3ed@bothner.com \
    --to=per@bothner.com \
    --cc=kawa@sourceware.org \
    --cc=vasanthaganesh.k@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).