From users-return-1405-apmail-groovy-users-archive=groovy.apache.org@groovy.apache.org Mon Feb 22 11:03:29 2016 Return-Path: X-Original-To: apmail-groovy-users-archive@minotaur.apache.org Delivered-To: apmail-groovy-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 16C4818786 for ; Mon, 22 Feb 2016 11:03:29 +0000 (UTC) Received: (qmail 39664 invoked by uid 500); 22 Feb 2016 11:02:54 -0000 Delivered-To: apmail-groovy-users-archive@groovy.apache.org Received: (qmail 39621 invoked by uid 500); 22 Feb 2016 11:02:54 -0000 Mailing-List: contact users-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@groovy.apache.org Delivered-To: mailing list users@groovy.apache.org Received: (qmail 39611 invoked by uid 99); 22 Feb 2016 11:02:54 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Feb 2016 11:02:54 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 12E941A41A8 for ; Mon, 22 Feb 2016 11:02:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.87 X-Spam-Level: X-Spam-Status: No, score=0.87 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RP_MATCHES_RCVD=-0.329, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=yahoo.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id MIAdHgTaGtSZ for ; Mon, 22 Feb 2016 11:02:52 +0000 (UTC) Received: from nm11-vm0.bullet.mail.bf1.yahoo.com (nm11-vm0.bullet.mail.bf1.yahoo.com [98.139.213.136]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 66C4E5F343 for ; Mon, 22 Feb 2016 11:02:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1456138966; bh=DtTT9nv0nTrKNZwkqdX/YLagvAlxHWUMkVwM3RgZZ7A=; h=Date:From:Reply-To:To:Subject:References:From:Subject; b=j0hwYQOfly4QrO1sYye5OLd0vY+Z8p5aeYe5cJNZoLgF5cVIla1svWxh8/2rkOceRE068AH4/Wi/1/YCPt/QLAJR6iuoQ+WtA1XmeO0j9MRiM6CWnVSRmNVR1O1WoiHnllSn8LX80WyrvFQWyy40LeY1+vYGlgoVC+LbtXVW0rFdiDfdEJIZYOw3Zr8x1wGahSwHuh5YbahNSxsclPKXm/bn8xzmxESRdlBkU2b7VnecMNhuwtO7RAe9tmdf9xeB9xP+hhoKDwoRsmW40FjKPvOCedCVjb/vinViX5nZKg1ILLX2yKVG/2qGvQW0PBOepnQ9w/LfaA1mmoacwuUl/Q== Received: from [98.139.170.181] by nm11.bullet.mail.bf1.yahoo.com with NNFMP; 22 Feb 2016 11:02:46 -0000 Received: from [98.139.212.212] by tm24.bullet.mail.bf1.yahoo.com with NNFMP; 22 Feb 2016 11:02:46 -0000 Received: from [127.0.0.1] by omp1021.mail.bf1.yahoo.com with NNFMP; 22 Feb 2016 11:02:46 -0000 X-Yahoo-Newman-Property: ymail-5 X-Yahoo-Newman-Id: 786582.71529.bm@omp1021.mail.bf1.yahoo.com X-YMail-OSG: d1mW9zcVM1nVFTwibMvSv_JkJ_xnAc2_tjAGZ1hBkhWAG8OZKxWcrkZWkoEaenV gaRJJMZieW0oy4n55QOgL5UT0bZfAfLrIjroFD31gDFXfeK0AeCfN8K4HLgFZnsGVlcke9rLPEAw z_xx642pT.uT_r5mWNrGb9FJgHx2FoYuVRIgNkXRZUgTyWxmI8BEPV01Y_oHvV5_0tC6CPErAgTF BKfk09GgQ5VTbFkDd5V6p4bk_erRta.RF1wFtYuDFhtJQZJljCOUF307o4p4CL8UfHVa8SIy5m5x qJaDdU0VQ.HEmcA.dGIP_PUBQCKPsWcEu4pXt7MtSw_TP6KojpZaD5.v6ru7TxrY.QcctV8zNjyx 65YjrLtlauO5LnRNXOvYPk7ORvqr9SFxm8KiKzmihzdwCGPulnXoI7w4rI.CCReqviSWCTES_veg .XbN5dRdZ.JUhuh.dGCZoib10Wczv8f0dTjMt.GhZfnlhHohI_dnmaVVlLh5MgMTLewQiJzT3uA8 7gln_YfEP9muc Received: by 66.196.81.117; Mon, 22 Feb 2016 11:02:46 +0000 Date: Mon, 22 Feb 2016 11:02:45 +0000 (UTC) From: Anton Sarov Reply-To: Anton Sarov To: "users@groovy.apache.org" Message-ID: <1114259145.8254493.1456138965960.JavaMail.yahoo@mail.yahoo.com> Subject: TypeChecked with apache commons Pair cannot find matching method MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_8254492_164193365.1456138965954" References: <1114259145.8254493.1456138965960.JavaMail.yahoo.ref@mail.yahoo.com> ------=_Part_8254492_164193365.1456138965954 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hello, I have a DSL and some AST transformations. Now I would like to include some 3rd party classes in my DSL. For example some apache commons lang classes like Pair, etc. In my language I offer the user the "bar()" method (which I have defined elsewhere). However the "bar()" method is just for user's convenience. Actually I am calling the "bar2()" method under the hood - this is why I have the AST transformation. So writing: def foo = bar() Becomes: def foo = bar2() as Pair Now consider this AFTER transformation statement: def foo = bar2() as Pairfoo.getKey()foo.getValue() Having the @TypeChecked annotation I get this error: Cannot find matching method org.apache.commons.lang3.tuple.Pair#getKey(). Please check if the declared type is right and if the method exists. But if I write something like: def foo = Pair.of(3,4)foo.getKey()foo.getValue() Then everything is fine. Is there something that I am missing. What is even more weird: I have my Type Checker extension and I see that "handleMissingMethod" is called for "foo.getKey()" so at this point I try to resolve the statement by myself but calling "...getDeclaredMethods(..)" returns an empty list. Best regardsAnton ------=_Part_8254492_164193365.1456138965954 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hell= o,

I have a DSL and some AST transf= ormations. Now I would like to include some 3rd party classes in my DSL. Fo= r example some apache commons lang classes like Pair, etc.

In my language I offer the user the "ba= r()" method (which I have defined elsewhere). However the "bar()" method is= just for user's convenience. Actually I am calling the "bar2()" method und= er the hood - this is why I have the AST transformation.

So writing:

def foo =3D bar()

Becomes:

def foo =3D= bar2() as Pair

Now consider this AFTER tra= nsformation statement:
def foo =3D bar2() as Pa= ir
foo.getKey()
foo.getValue()

Having the @TypeChecked annotati= on I get this error: Cannot find matching method org.apache.commons.lang3.t= uple.Pair#getKey(). Please check if the declared type is right and if the m= ethod exists.

But i= f I write something like:

def foo = =3D Pair.of(3,4)
foo.getKe= y()
foo.getVal= ue()

Then everything is= fine. Is there something that I am missing. What is even more weird: I hav= e my Type Checker extension and I see that "handleMissingMethod" is called = for "foo.getKey()" so at this point I try to resolve the statement by mysel= f but calling "...getDeclaredMethods(..)" returns an empty list.

Best regards
Anton
------=_Part_8254492_164193365.1456138965954--