You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2021/12/20 13:55:00 UTC
[jira] [Resolved] (GROOVY-7998) Disallow automatic String conversion in static compilation context
[ https://issues.apache.org/jira/browse/GROOVY-7998?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles resolved GROOVY-7998.
---------------------------------
Resolution: Won't Do
> Disallow automatic String conversion in static compilation context
> ------------------------------------------------------------------
>
> Key: GROOVY-7998
> URL: https://issues.apache.org/jira/browse/GROOVY-7998
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 2.4.7
> Reporter: Graeme Rocher
> Priority: Major
>
> 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
(v8.20.1#820001)