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 2022/02/03 22:51:00 UTC
[jira] [Closed] (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 ]
Paul King closed GROOVY-7998.
-----------------------------
> 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)