[
https://issues.apache.org/jira/browse/GROOVY-8130?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul King resolved GROOVY-8130.
-------------------------------
Resolution: Fixed
Assignee: Paul King
Fix Version/s: 2.4.13
This seems to be fixed in 2.4.13.
> Cannot call private constructor error - @CompileStatic & default method
> argument
> --------------------------------------------------------------------------------
>
> Key: GROOVY-8130
> URL: https://issues.apache.org/jira/browse/GROOVY-8130
> Project: Groovy
> Issue Type: Bug
> Components: Static compilation
> Affects Versions: 2.4.7, 2.4.10
> Reporter: Marcin Zajaczkowski
> Assignee: Paul King
> Priority: Minor
> Fix For: 2.4.13
>
>
> Groovy compiler reports error on a try of use private constructor with
> default method argument from a static method:
> Error:(15, 16) Groovyc: Cannot call private constructor for
> com.ofg.test.CannotCallPrivateConstructorIssueReproductor from class
> com.ofg.test.CannotCallPrivateConstructorIssueReproductor
> Sample code to reproduce that issue:
> {code}
> @CompileStatic
> class CannotCallPrivateConstructorIssueReproductor {
> private final String someFiled //final is NOT mandatory to reproduce the
> issue
> private CannotCallPrivateConstructorIssueReproductor(String someFiled,
> Integer optionalArgument = null) { //field with default value is crutial
> this.someFiled = someFiled
> }
> static CannotCallPrivateConstructorIssueReproductor factoryMethod() {
> return new CannotCallPrivateConstructorIssueReproductor('sth')
> }
> }
> {code}
> Tested with Groovy 2.4.7 and 2.4.10
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)