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 2020/06/12 22:44:00 UTC
[jira] [Assigned] (GROOVY-9587) Scope of method call changed from
non-static to static 2.4->2.5
[ https://issues.apache.org/jira/browse/GROOVY-9587?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles reassigned GROOVY-9587:
-----------------------------------
Assignee: Eric Milles
> Scope of method call changed from non-static to static 2.4->2.5
> ---------------------------------------------------------------
>
> Key: GROOVY-9587
> URL: https://issues.apache.org/jira/browse/GROOVY-9587
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 2.5.12
> Reporter: Eric Helgeson
> Assignee: Eric Milles
> Priority: Major
>
>
> {code:java}
> class Foo {
> static storageProvider
> def getStorageProvider(Boolean a) {
> return storageProvider
> }
> def getStorageProvider() {
> if(!storageProvider) {
> getStorageProvider(true) // <-- Attempts to call statically in 2.5
> }
> return storageProvider
> }
> }
> new Foo().getStorageProvider()
> {code}
> In groovy 2.5+ it seems it gets confused if you have a static variable in a class, say static storageProvider, and a non-static method def getStorageProvider(Boolean x) it tries to call the getStorageProvider(true) statically, which does not exist.
>
> In the groovyConsole you can see the change happen between conversion and semantic analysis - it changes from non-static to static.
>
> Unsure this is intended or not. I couldn't find mention of it in any changes. It would be nice to document/know why the change happened between 2.4/2.5.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)