You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Shil Sinha (JIRA)" <ji...@apache.org> on 2017/01/03 21:49:58 UTC

[jira] [Commented] (GROOVY-8033) STC: spread property references fails in static method

    [ https://issues.apache.org/jira/browse/GROOVY-8033?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15796284#comment-15796284 ] 

Shil Sinha commented on GROOVY-8033:
------------------------------------

This seems to occur in all cases when the inferred type of the collection variable is not derived from List (e.g. Set, Queue, etc.)

> 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
>
> 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)