You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2017/11/14 22:03:00 UTC
[jira] [Comment Edited] (GROOVY-8380) Regression in 2.4.13
(snapshot) 62615249161b233b1827d5950671d3a83007cd9f
[ https://issues.apache.org/jira/browse/GROOVY-8380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16252522#comment-16252522 ]
Paul King edited comment on GROOVY-8380 at 11/14/17 10:02 PM:
--------------------------------------------------------------
It's not clear to me if this is a bug.
Dynamic Groovy does not match that constructor in 2.4.12 due to possible loss of precision (and I tried numerous versions back to 1.8.9 with the same result):
{noformat}
groovy.lang.GroovyRuntimeException:
Could not find matching constructor for: java.lang.Long(java.math.BigDecimal)
{noformat}
Perhaps we need an error message indicating possible loss of precision as the cause.
Static Groovy also rejects: {{Long foo = 5 / 3}} but dynamic Groovy accepts this.
Anyway, let's see what others think.
was (Author: paulk):
It's not clear to me if this is a bug.
Dynamic Groovy does not match that constructor in 2.4.12 due to possible loss of precision (and I tried numerous versions back to 1.8.9 with the same result):
{noformat}
groovy.lang.GroovyRuntimeException: Could not find matching constructor for: java.lang.Long(java.math.BigDecimal)
{noformat}
Perhaps we need an error message indicating possible loss of precision as the cause.
Static Groovy also rejects: {{Long foo = 5 / 3}} but dynamic Groovy accepts this.
Anyway, let's see what others think.
> 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)