[
https://issues.apache.org/jira/browse/GROOVY-8033?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15798845#comment-15798845
]
ASF GitHub Bot commented on GROOVY-8033:
----------------------------------------
GitHub user shils opened a pull request:
https://github.com/apache/groovy/pull/476
GROOVY-8033: spread property calls on non-list collections fail STC i…
…n static methods
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/shils/groovy GROOVY-8033
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/groovy/pull/476.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 #476
----
commit 7821c9b030ac61e30f8ea85fc962c6019b52302a
Author: Shil Sinha <[email protected]>
Date: 2017-01-04T17:26:37Z
GROOVY-8033: spread property calls on non-list collections fail STC in
static methods
----
> STC: spread property references fails in static method
> ------------------------------------------------------
>
> Key: GROOVY-8033
> URL: https://issues.apache.org/jira/browse/GROOVY-8033
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Affects Versions: 2.4.7
> Reporter: Eric Milles
> Assignee: Shil Sinha
>
> I managed to boil this down to static method versus non-static method. When
> I use the spread operator in a Set to access a property (backed by getter), I
> am getting a type checking error. If I remove the TypeChecked, all is well.
> If I remove static from the method, all is well.
> {code}
> @groovy.transform.TypeChecked
> class Foo {
> static def meth() {
> Set<java.beans.BeanInfo> defs = []
> defs*.additionalBeanInfo
> }
> }
> {code}
> Error during compile (or in the IDE):
> Foo.groovy: 11: [Static type checking] - No such property: additionalBeanInfo
> for class: java.util.Set <java.beans.BeanInfo>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)