[jira] [Commented] (GROOVY-8220) GroovyCastException with CompileStatic

2017-09-28 Thread paolo di tommaso (JIRA)

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

paolo di tommaso commented on GROOVY-8220:
--

Yes, the the CI build is 
[green|http://ci.groovy-lang.org/viewLog.html?buildTypeId=JointBuilds_Nextflow_Groovy24xJointBuild=42830]!
 Thanks you all.  

> GroovyCastException with CompileStatic
> --
>
> Key: GROOVY-8220
> URL: https://issues.apache.org/jira/browse/GROOVY-8220
> Project: Groovy
>  Issue Type: Bug
>Affects Versions: 2.5.0-beta-1, 2.4.12
>Reporter: paolo di tommaso
>Assignee: John Wagenleitner
> Fix For: 2.4.13
>
>
> {code}
> @groovy.transform.CompileStatic
> class Foo {
> CharSequence makeEnv( env, StringBuilder result = new StringBuilder() ) {
> if( env instanceof File ) {
> env = env.toPath()
> }
> if( env instanceof String && env.contains('=') ) {
> result << 'export ' << env << ';'
> }
> return result.toString()
> }
> }
> assert new Foo().makeEnv('X=1') == 'export X=1;'
> Exception thrown
> org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast 
> object 'X=1' with class 'java.lang.String' to class 'java.lang.Iterable'
>   at Foo.makeEnv(ConsoleScript5:10)
>   at Foo.makeEnv(ConsoleScript5:4)
>   at Foo$makeEnv.call(Unknown Source)
>   at ConsoleScript5.run(ConsoleScript5:20)
> {code}
> Without CompileStatic it works as expected. 



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


[jira] [Commented] (GROOVY-8220) GroovyCastException with CompileStatic

2017-09-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on GROOVY-8220:


Github user paulk-asert closed the pull request at:

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


> GroovyCastException with CompileStatic
> --
>
> Key: GROOVY-8220
> URL: https://issues.apache.org/jira/browse/GROOVY-8220
> Project: Groovy
>  Issue Type: Bug
>Affects Versions: 2.5.0-beta-1, 2.4.12
>Reporter: paolo di tommaso
>
> {code}
> @groovy.transform.CompileStatic
> class Foo {
> CharSequence makeEnv( env, StringBuilder result = new StringBuilder() ) {
> if( env instanceof File ) {
> env = env.toPath()
> }
> if( env instanceof String && env.contains('=') ) {
> result << 'export ' << env << ';'
> }
> return result.toString()
> }
> }
> assert new Foo().makeEnv('X=1') == 'export X=1;'
> Exception thrown
> org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast 
> object 'X=1' with class 'java.lang.String' to class 'java.lang.Iterable'
>   at Foo.makeEnv(ConsoleScript5:10)
>   at Foo.makeEnv(ConsoleScript5:4)
>   at Foo$makeEnv.call(Unknown Source)
>   at ConsoleScript5.run(ConsoleScript5:20)
> {code}
> Without CompileStatic it works as expected. 



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


[jira] [Commented] (GROOVY-8220) GroovyCastException with CompileStatic

2017-09-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on GROOVY-8220:


Github user asfgit closed the pull request at:

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


> GroovyCastException with CompileStatic
> --
>
> Key: GROOVY-8220
> URL: https://issues.apache.org/jira/browse/GROOVY-8220
> Project: Groovy
>  Issue Type: Bug
>Affects Versions: 2.5.0-beta-1, 2.4.12
>Reporter: paolo di tommaso
>
> {code}
> @groovy.transform.CompileStatic
> class Foo {
> CharSequence makeEnv( env, StringBuilder result = new StringBuilder() ) {
> if( env instanceof File ) {
> env = env.toPath()
> }
> if( env instanceof String && env.contains('=') ) {
> result << 'export ' << env << ';'
> }
> return result.toString()
> }
> }
> assert new Foo().makeEnv('X=1') == 'export X=1;'
> Exception thrown
> org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast 
> object 'X=1' with class 'java.lang.String' to class 'java.lang.Iterable'
>   at Foo.makeEnv(ConsoleScript5:10)
>   at Foo.makeEnv(ConsoleScript5:4)
>   at Foo$makeEnv.call(Unknown Source)
>   at ConsoleScript5.run(ConsoleScript5:20)
> {code}
> Without CompileStatic it works as expected. 



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


[jira] [Commented] (GROOVY-8220) GroovyCastException with CompileStatic

2017-09-23 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on GROOVY-8220:


GitHub user paulk-asert opened a pull request:

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

GROOVY-8220: GroovyCastException with CompileStatic



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/paulk-asert/groovy groovy8220b

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/groovy/pull/606.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #606


commit 9c39935ad5005dddf11816eaf0106227545fdb54
Author: paulk 
Date:   2017-09-24T02:58:52Z

GROOVY-8220: GroovyCastException with CompileStatic




> GroovyCastException with CompileStatic
> --
>
> Key: GROOVY-8220
> URL: https://issues.apache.org/jira/browse/GROOVY-8220
> Project: Groovy
>  Issue Type: Bug
>Affects Versions: 2.5.0-beta-1, 2.4.12
>Reporter: paolo di tommaso
>
> {code}
> @groovy.transform.CompileStatic
> class Foo {
> CharSequence makeEnv( env, StringBuilder result = new StringBuilder() ) {
> if( env instanceof File ) {
> env = env.toPath()
> }
> if( env instanceof String && env.contains('=') ) {
> result << 'export ' << env << ';'
> }
> return result.toString()
> }
> }
> assert new Foo().makeEnv('X=1') == 'export X=1;'
> Exception thrown
> org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast 
> object 'X=1' with class 'java.lang.String' to class 'java.lang.Iterable'
>   at Foo.makeEnv(ConsoleScript5:10)
>   at Foo.makeEnv(ConsoleScript5:4)
>   at Foo$makeEnv.call(Unknown Source)
>   at ConsoleScript5.run(ConsoleScript5:20)
> {code}
> Without CompileStatic it works as expected. 



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


[jira] [Commented] (GROOVY-8220) GroovyCastException with CompileStatic

2017-06-25 Thread John Wagenleitner (JIRA)

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

John Wagenleitner commented on GROOVY-8220:
---

Fix for GROOVY-8157 seems to be the cause.

> GroovyCastException with CompileStatic
> --
>
> Key: GROOVY-8220
> URL: https://issues.apache.org/jira/browse/GROOVY-8220
> Project: Groovy
>  Issue Type: Bug
>Affects Versions: 2.5.0-beta-1
>Reporter: paolo di tommaso
>
> {code}
> @groovy.transform.CompileStatic
> class Foo {
> CharSequence makeEnv( env, StringBuilder result = new StringBuilder() ) {
> if( env instanceof File ) {
> env = env.toPath()
> }
> if( env instanceof String && env.contains('=') ) {
> result << 'export ' << env << ';'
> }
> return result.toString()
> }
> }
> assert new Foo().makeEnv('X=1') == 'export X=1;'
> Exception thrown
> org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast 
> object 'X=1' with class 'java.lang.String' to class 'java.lang.Iterable'
>   at Foo.makeEnv(ConsoleScript5:10)
>   at Foo.makeEnv(ConsoleScript5:4)
>   at Foo$makeEnv.call(Unknown Source)
>   at ConsoleScript5.run(ConsoleScript5:20)
> {code}
> Without CompileStatic it works as expected. 



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