groovy-notifications mailing list archives

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

    [ https://issues.apache.org/jira/browse/GROOVY-7883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16472928#comment-16472928
] 

ASF GitHub Bot commented on GROOVY-7883:
----------------------------------------

Github user asfgit closed the pull request at:

    https://github.com/apache/groovy/pull/705


> 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
>            Priority: Major
>
> 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