groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patric Bechtel (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-8325) @CompileStatic calls wrong newInstance method.
Date Tue, 14 Nov 2017 15:06:00 GMT

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

Patric Bechtel commented on GROOVY-8325:
----------------------------------------

Please have a look at GROOVY-8380, as this fix causes a regression for

@groovy.transform.CompileStatic
def bla() {
   new Long( 5 / 2 )
}

That used to work and seems on par with the Java behaviour on that matter.

> @CompileStatic calls wrong newInstance method.
> ----------------------------------------------
>
>                 Key: GROOVY-8325
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8325
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler, Static compilation
>    Affects Versions: 2.4.10
>            Reporter: Xiaoguang WANG
>            Assignee: Paul King
>            Priority: Critical
>             Fix For: 2.4.13
>
>
> {code:java}
> import groovy.transform.CompileStatic
> class Foo {
>     static Foo newInstance(Long v) {
>         return new Foo()
>     }
> }
> @CompileStatic   //crash only caused by this CompileStatic
> class TestGroovy {
>     static void main(String ... args) {
>         def a = Foo.newInstance(123)  //when @CompileStatic, this calls DefaultGroovyMethods.newInstance
>         println a
>     }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message