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

STC: map properties "class" and "empty" indicated as read-only

    XMLWordPrintableJSON

Details

    Description

      Consider the following:

      @TypeChecked test(Map map) {
        print map.empty
        print map.class
        print map.metaClass
      
        map.empty = null
        map.class = null
        map.metaClass = null
      
        print map
      }
      test([:])
      

      When executed (without @TypeChecked) the script prints "null", "null", "null", "[empty: null, class: null, metaClass: null]". So these are all map entry read and writes. However, STC indicates that "class" and "empty" are read-only properties.

      Attachments

        Issue Links

          Activity

            People

              emilles Eric Milles
              emilles Eric Milles
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: