From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from aibo.runbox.com (aibo.runbox.com [91.220.196.211]) by sourceware.org (Postfix) with ESMTPS id BBEDA398580D for ; Thu, 7 May 2020 16:49:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BBEDA398580D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=bothner.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=per@bothner.com Received: from [10.9.9.203] (helo=mailfront21.runbox) by mailtransmit02.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1jWjiT-0000Ug-Aw; Thu, 07 May 2020 18:49:45 +0200 Received: by mailfront21.runbox with esmtpsa [Authenticated alias (524175)] (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) id 1jWji2-0004XV-I4; Thu, 07 May 2020 18:49:18 +0200 Subject: Re: Calling Inner Class To: Andy Zhang , "kawa@sourceware.org" References: From: Per Bothner Message-ID: <6e9c5a5c-490b-7c32-ed6d-17f3e5fa3035@bothner.com> Date: Thu, 7 May 2020 09:49:14 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: kawa@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Kawa mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 May 2020 16:49:58 -0000 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/