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 0AA99200BA4 for ; Sat, 15 Oct 2016 20:00:24 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 091D6160AF1; Sat, 15 Oct 2016 18:00:24 +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 4DE8C160AD9 for ; Sat, 15 Oct 2016 20:00:23 +0200 (CEST) Received: (qmail 49289 invoked by uid 500); 15 Oct 2016 18:00:22 -0000 Mailing-List: contact notifications-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list notifications@groovy.apache.org Received: (qmail 49270 invoked by uid 99); 15 Oct 2016 18:00:22 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 15 Oct 2016 18:00:22 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 69AB32C0088 for ; Sat, 15 Oct 2016 18:00:22 +0000 (UTC) Date: Sat, 15 Oct 2016 18:00:22 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: notifications@groovy.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (GROOVY-7932) Cannot call private constructor from closures with @CompileStatic MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 15 Oct 2016 18:00:24 -0000 [ https://issues.apache.org/jira/browse/GROOVY-7932?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D155= 78506#comment-15578506 ]=20 ASF GitHub Bot commented on GROOVY-7932: ---------------------------------------- GitHub user shils opened a pull request: https://github.com/apache/groovy/pull/449 GROOVY-7932: generate bridge methods for private constructors during = =E2=80=A6 =E2=80=A6static compilation You can merge this pull request into a Git repository by running: $ git pull https://github.com/shils/groovy GROOVY-7932 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/449.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #449 =20 ---- commit 7b0b5f81b9bffc0c3223ae18921d7f23bca83f96 Author: Shil Sinha Date: 2016-10-09T20:57:47Z GROOVY-7932: generate bridge methods for private constructors during st= atic compilation ---- > Cannot call private constructor from closures with @CompileStatic > ----------------------------------------------------------------- > > Key: GROOVY-7932 > URL: https://issues.apache.org/jira/browse/GROOVY-7932 > Project: Groovy > Issue Type: Bug > Components: Static compilation > Affects Versions: 2.4.7, 2.5.x > Environment: Ubuntu 16.04 > openjdk version "1.8.0_91" > Reporter: Cazacu Mihai > Assignee: Shil Sinha > > {code:title=3DTest.groovy|borderStyle=3Dsolid} > import groovy.transform.CompileStatic > @CompileStatic > interface Handler { > void handle(E event) > } > @CompileStatic > class Person { > final String name > // marking this method as 'protected' will fix the issue > private Person(String name) { > this.name =3D name > } > static void load(String name, Handler handler) { > Thread.start { > Person person =3D new Person(name) > handler.handle(person) > } > } > } > Person.load('John') { Person p -> > println p.name > } > {code} > Error: > {quote} > Test.groovy: 20: Cannot call private constructor for Person from class Pe= rson$_load_closure1 @ line 20, column 20. > =09=09=09Person person =3D new Person(name) > ^ > 1 error > {quote} -- This message was sent by Atlassian JIRA (v6.3.4#6332)