You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Pascal Schumacher (JIRA)" <ji...@apache.org> on 2017/01/13 22:45:26 UTC
[jira] [Closed] (GROOVY-7999) Disallow automatic String conversion
in static compilation context
[ https://issues.apache.org/jira/browse/GROOVY-7999?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pascal Schumacher closed GROOVY-7999.
-------------------------------------
Resolution: Duplicate
> Disallow automatic String conversion in static compilation context
> ------------------------------------------------------------------
>
> Key: GROOVY-7999
> URL: https://issues.apache.org/jira/browse/GROOVY-7999
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 2.4.7
> Reporter: Graeme Rocher
>
> This code:
> {code}
> @groovy.transform.CompileStatic
> class Bar {
> protected List bar = []
>
> boolean doStuff() {
> String bar = this.bar
> return bar.isEmpty()
> }
> }
> new Bar().doStuff()
> {code}
> Prints false. IMO it should not be possible to assign a List to a String and in a static compilation context this should be a compilation error.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)