public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
* Calling Inner Class
@ 2020-05-07 15:06 Andy Zhang
  2020-05-07 16:49 ` Per Bothner
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Zhang @ 2020-05-07 15:06 UTC (permalink / raw)
  To: kawa

Hi,

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) 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')

All the classes are imported correctly.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Calling Inner Class
  2020-05-07 15:06 Calling Inner Class Andy Zhang
@ 2020-05-07 16:49 ` Per Bothner
  0 siblings, 0 replies; 2+ messages in thread
From: Per Bothner @ 2020-05-07 16:49 UTC (permalink / raw)
  To: Andy Zhang, kawa

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/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-07 16:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-07 15:06 Calling Inner Class Andy Zhang
2020-05-07 16:49 ` Per Bothner

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).