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

@CompileStatic class property accessed instead of map property

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.8
    • 2.4.12
    • Static compilation
    • None

    Description

      class MyMap extends LinkedHashMap {
        def foo = 1
      }
      
      @CompileStatic
      class Main {
        static void main(String[] args) {
          def map = new MyMap()
          map.put('foo', 42)
          println map.foo // 1 is printed, should be 42
        }
      }
      

      Attachments

        Issue Links

          Activity

            People

              shils Shil Sinha
              daniilo Daniil Ovchinnikov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: