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

Difference in behaviour with closure and lambda

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.0-alpha-4
    • 3.0.0-beta-1
    • Compiler
    • None

    Description

      foo {
        closure
      }
      .bar {
        closure2
      }
      //produced binary like
      this.foo({ 
          return closure 
      }).bar({ 
          return closure2 
      })
      

      but

      foo ()->{
        closure
      }
      .bar ()->{
        closure2
      }
      //produced binary like
      this.foo({ 
          return closure 
      }.bar).{ 
          return closure2 
      }
      

      I believe this difference is quite unexpected.

      Attachments

        Issue Links

          Activity

            People

              daniel_sun Daniel Sun
              Alexey Afanasiev Alexey Afanasiev
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m