groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Sun (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (GROOVY-7883) Static compiler prefers private constructor over public if private matches better
Date Sat, 12 May 2018 06:17:00 GMT

     [ https://issues.apache.org/jira/browse/GROOVY-7883?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Daniel Sun resolved GROOVY-7883.
--------------------------------
       Resolution: Fixed
         Assignee: Daniel Sun
    Fix Version/s: 2.5.0-rc-3
                   3.0.0-alpha-3
                   2.6.0-alpha-4

Fixed by https://github.com/apache/groovy/commit/b1d1232770aade9672668df4dbc6aa2e2076fa9e

> Static compiler prefers private constructor over public if private matches better
> ---------------------------------------------------------------------------------
>
>                 Key: GROOVY-7883
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7883
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static compilation
>    Affects Versions: 2.4.7
>            Reporter: Jason Winnebeck
>            Assignee: Daniel Sun
>            Priority: Major
>             Fix For: 2.6.0-alpha-4, 3.0.0-alpha-3, 2.5.0-rc-3
>
>
> When constructing an AssertionError for example, it has a public constructor taking Object
and a private constructor taking String. The static compiler "chooses" the private constructor
over the public one and this results in a compile error.
> {code}
> @groovy.transform.CompileStatic
> void doIt() {
>   //Cannot call private constructor for java.lang.AssertionError. However, it should
call AssertionError(Object)
>   throw new AssertionError("abc")
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message