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 75027200BAB for ; Sat, 22 Oct 2016 23:14:00 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 73A53160AEF; Sat, 22 Oct 2016 21:14:00 +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 C1798160ADB for ; Sat, 22 Oct 2016 23:13:59 +0200 (CEST) Received: (qmail 74098 invoked by uid 500); 22 Oct 2016 21:13:58 -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 74080 invoked by uid 99); 22 Oct 2016 21:13:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 22 Oct 2016 21:13:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 8C33F2C0D55 for ; Sat, 22 Oct 2016 21:13:58 +0000 (UTC) Date: Sat, 22 Oct 2016 21:13:58 +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: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 22 Oct 2016 21:14:00 -0000 [ https://issues.apache.org/jira/browse/GROOVY-7932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15598512#comment-15598512 ] ASF GitHub Bot commented on GROOVY-7932: ---------------------------------------- Github user asfgit closed the pull request at: https://github.com/apache/groovy/pull/449 > 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=Test.groovy|borderStyle=solid} > 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 = name > } > static void load(String name, Handler handler) { > Thread.start { > Person person = 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 Person$_load_closure1 @ line 20, column 20. > Person person = new Person(name) > ^ > 1 error > {quote} -- This message was sent by Atlassian JIRA (v6.3.4#6332)