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

STC: map property access within closure

    XMLWordPrintableJSON

Details

    Description

      Consider the following:

      void test(Map map) {
        println map.empty
        println map.with{ empty }
        println map.with{ delegate.empty }
        println map.with{ {->owner.empty}() }
      }
      
      test( [:].withDefault{ 'entry' } )
      

      When run as-is, the script prints "entry entry entry entry". With STC or SC enabled, Groovy 3 or 4 prints "entry true true true".

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: