public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Per Bothner <per@bothner.com>
To: Andy Zhang <andy.zhang@duke.edu>,
	"kawa@sourceware.org" <kawa@sourceware.org>
Subject: Re: Calling Inner Class
Date: Thu, 7 May 2020 09:49:14 -0700	[thread overview]
Message-ID: <6e9c5a5c-490b-7c32-ed6d-17f3e5fa3035@bothner.com> (raw)
In-Reply-To: <CH2PR05MB6838242E49C39D6E9A71FAD6F9A50@CH2PR05MB6838.namprd05.prod.outlook.com>

On 5/7/20 8:06 AM, Andy Zhang via Kawa wrote:
> If I were to call a non-static inner class from a Java outer class in kawa, what would the syntax look like? I have tried
> (outerclass-instance:innerclass args)

That looks like the correct syntax.


> but this gives me the error
> 
> class gnu.bytecode.ClassType cannot be cast to class gnu.expr.PairClassType (gnu.bytecode.ClassType and gnu.expr.PairClassType are in unnamed module of loader 'app')

It is possible this isn't supported.  However, the reference to PairClassType suggests
"pair class" is either being generated or expected.  A "pair class" is a pair
of a class and an interface used to implement true multiple inheritance.

See the inetrface: property in:
https://www.gnu.org/software/kawa/Defining-new-classes.html

If you're using define-class you might try using define-simple-class or
explicitly setting the "interface:" class property.

It is also possible Kawa is confused in expecting a PairClassType.
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/

      reply	other threads:[~2020-05-07 16:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-07 15:06 Andy Zhang
2020-05-07 16:49 ` Per Bothner [this message]

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=6e9c5a5c-490b-7c32-ed6d-17f3e5fa3035@bothner.com \
    --to=per@bothner.com \
    --cc=andy.zhang@duke.edu \
    --cc=kawa@sourceware.org \
    /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).