Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-8033

STC: spread property references fails in static method

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.7
    • 2.5.0-alpha-1
    • Static Type Checker
    • None

    Description

      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.

      @groovy.transform.TypeChecked
      class Foo {
        static def meth() {
          Set<java.beans.BeanInfo> defs = []
          defs*.additionalBeanInfo
        }
      }
      

      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>

      Attachments

        Issue Links

          Activity

            People

              shils Shil Sinha
              emilles Eric Milles
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: