Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 678DC200C3F for ; Wed, 22 Mar 2017 14:29:09 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 6626E160B86; Wed, 22 Mar 2017 13:29:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 84EF1160B83 for ; Wed, 22 Mar 2017 14:29:08 +0100 (CET) Received: (qmail 18109 invoked by uid 500); 22 Mar 2017 13:29:07 -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 18099 invoked by uid 99); 22 Mar 2017 13:29:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Mar 2017 13:29:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 28FB91812EB for ; Wed, 22 Mar 2017 13:29:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.129 X-Spam-Level: *** X-Spam-Status: No, score=3.129 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, HTML_MESSAGE=2, KAM_NUMSUBJECT=0.5, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id lsPro6TJ3o0I for ; Wed, 22 Mar 2017 13:29:06 +0000 (UTC) Received: from mail-vk0-f54.google.com (mail-vk0-f54.google.com [209.85.213.54]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 692C35FCFA for ; Wed, 22 Mar 2017 13:29:05 +0000 (UTC) Received: by mail-vk0-f54.google.com with SMTP id r69so14470859vke.2 for ; Wed, 22 Mar 2017 06:29:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=YvCCqYIHFBmOl3NSzDR2lylPLT5cKU8n0YV0wMFIvIQ=; b=bnUHYuiRdJODtZ/0Ii4xHH3vYtv0P9Xv7hZnZwO7r3N3bOh7jDVwpibTZ6Hnrb4ujf B7gHY2hUmw8XDGYTZ+73rMu4y9hhzlEtmm8kk8T26tw+X+rv6ooUFjOUMcrBwiEvrj3/ lHGKHHl2Gvu4ZS4K/l4lhS2NMTpggdc1d6gzthf6613VXDfL6KPxwgCtbeKtYRLd/Sqy pVge5NInsjwKgSLGsOfcOXXIQdlSlKSfN4ODItw0KE4akBa/zF4d+0MJVAydgJeyQKvQ 6ELqfmbqYR3jCn674uCrY+Np9h6E+CiBPT1I56VLu3NRtWa6G05oNvVrfPkbqm3hhjAT gdGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=YvCCqYIHFBmOl3NSzDR2lylPLT5cKU8n0YV0wMFIvIQ=; b=Ltqpz86+0DUS7UkOkpJY6ks+tg6Jyy6ywLcVcFDT+6pzG5Q4XSZmhVrGP9sM0iNP3u 6Ur8i+6ckh1wSt/Tn26F7s6NFgsHGvXUk5lz/7xK+WPqHtxzPAuxryUXK+9Hul5JUdsh 4oU1hbkwp+mPRg17n0al15RPhBmYhNyMqmkfCKuAlHCFiDJywVKLk9kNndpKAvXdQlt2 bYAlPvoFqdXjoye224VZIwxYHXJNdH8FW9QKcGUtu15SJ3LY6WbbZkSwgF0gje9GjKZ/ ATGP5j8EYYRTItyeSJojN6yXbUZIjIBJY4WGycnsZBvnpGBa8N05iBXnkKrJWkJ+Audz gvEA== X-Gm-Message-State: AFeK/H085nyz+JgesZxYIKzhuewJJU+IKciYQ5qvOXYWjwsxFV3vAn8dzkh+qNIF4PGVDHndLhjvqkNRqNaf+Q== X-Received: by 10.176.69.137 with SMTP id u9mr17430371uau.164.1490189344171; Wed, 22 Mar 2017 06:29:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.176.0.113 with HTTP; Wed, 22 Mar 2017 06:29:03 -0700 (PDT) In-Reply-To: References: From: =?UTF-8?Q?Fran=C3=A7ois_Guillot?= Date: Wed, 22 Mar 2017 14:29:03 +0100 Message-ID: Subject: Re: Compile error with 2.4.10 To: users@groovy.apache.org, paulk@asert.com.au Content-Type: multipart/alternative; boundary=94eb2c11c63081f1e5054b51be91 archived-at: Wed, 22 Mar 2017 13:29:09 -0000 --94eb2c11c63081f1e5054b51be91 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Paul, Thanks. I removed a bunch of 'final' in the Trait and dependents classes and it seems to work. Created https://issues.apache.org/jira/browse/GROOVY-8127 as well Cheers, Fran=C3=A7ois 2017-03-22 14:08 GMT+01:00 Paul King : > The method that throws that error hasn't changed recently but it looks > like another case that isn't handled correctly with final fields in a > trait. I'll have to investigate further to be sure. Can you create a > Jira issue? > > Workaround would be to remove the final for now. > > Cheers, Paul. > > On Wed, Mar 22, 2017 at 10:38 PM, Fran=C3=A7ois Guillot > wrote: > > H, > > > > I'm switching from Groovy 2.4.7 to 2.4.10 in my project. > > > > I have a compile error with 2.4.10. > > Simplified example: > > << > > > > import groovy.transform.CompileStatic > > import org.junit.Rule > > import org.junit.rules.TestRule > > > > @CompileStatic > > trait FooTrait { > > > > @Rule > > public final TestRule foo =3D {} as TestRule > > > > } > > > >>> > > > > I get "Error:Groovyc: Access to > > com.gradle.ratpack.test.FooTrait$Trait$Helper#$self is forbidden" > > > > Another variant of this error is "Error:Groovyc: Apparent variable > '$self' > > was found in a static scope but doesn't refer to a local variable, stat= ic > > field or class." > > > > Is there sth I need to change, or is there a workaround ? > > > > Thanks, > > > > Fran=C3=A7ois > --94eb2c11c63081f1e5054b51be91 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Paul,

Thanks. I removed a bunch of &= #39;final' in the Trait and dependents classes and it seems to work.





2017-03-22 14:08 GMT+01:00 Paul King <paulk@asert.com.au>= ;:
The method t= hat throws that error hasn't changed recently but it looks
like another case that isn't handled correctly with final fields in a trait. I'll have to investigate further to be sure. Can you create a Jira issue?

Workaround would be to remove the final for now.

Cheers, Paul.

On Wed, Mar 22, 2017 at 10:38 PM, Fran=C3=A7ois Guillot
<francoisguillot73@gmail.= com> wrote:
> H,
>
> I'm switching from Groovy 2.4.7 to 2.4.10 in my project.
>
> I have a compile error with 2.4.10.
> Simplified example:
> <<
>
> import groovy.transform.CompileStatic
> import org.junit.Rule
> import org.junit.rules.TestRule
>
> @CompileStatic
> trait FooTrait {
>
>=C2=A0 =C2=A0 =C2=A0@Rule
>=C2=A0 =C2=A0 =C2=A0public final TestRule foo =3D {} as TestRule
>
> }
>
>>>
>
> I get "Error:Groovyc: Access to
> com.gradle.ratpack.test.FooTrait$Trait$Helper#$self is forbidden&= quot;
>
> Another variant of this error is "Error:Groovyc: Apparent variabl= e '$self'
> was found in a static scope but doesn't refer to a local variable,= static
> field or class."
>
> Is there sth I need to change, or is there a workaround ?
>
> Thanks,
>
> Fran=C3=A7ois

--94eb2c11c63081f1e5054b51be91--