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

Jochen Theodorou commented on GROOVY-8380:
------------------------------------------

The GRE for new Integer(wl & wl) is a bit strange to be frank. Looking at 
https://github.com/codehaus/groovy-git/blob/master/src/main/org/codehaus/groovy/reflection/stdclasses/IntegerCachedClass.java#L51
 I see BigInteger but not Long and long.... so while this explains the GRE I 
feel like something is wrong here. How can a BigInteger be ok, but a Long not? 
This means I can do {code:Java}
​def foo(int i) {1}
assert foo(Long.MAX_VALUE as BigInteger)​ == 1​
{code} But I cannot do {code:Java}
​def foo(int i) {1}
assert foo(1L)​ == 1​
{code}
Anyway... this is probably another issue and not subject of this here. Here it 
is all about the remaining STC failure 

> Regression in 2.4.13 (snapshot) 62615249161b233b1827d5950671d3a83007cd9f
> ------------------------------------------------------------------------
>
>                 Key: GROOVY-8380
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8380
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static compilation
>    Affects Versions: 2.4.13
>         Environment: any
>            Reporter: Patric Bechtel
>            Priority: Critical
>
> This used to work up to 2.4.12:
> {code}
> @groovy.transform.CompileStatic
> class bla {
>    static void main(String[] args) {
>       println new Long( 5 / 3 )
>    }
> }
> {code}
> starting with 2.4.13, it gives this error message:
> {noformat}
> bla.groovy: 4: [Static type checking] - Cannot find matching method 
> java.lang.Long#<init>(java.math.BigDecimal). Please check if the declared 
> type is right and if the method exists.
>  @ line 4, column 15.
>          println new Long( 5 / 3 )
> {noformat}



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

Reply via email to