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

Difference in behaviour with closure and lambda

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0-alpha-4
    • Fix Version/s: 3.0.0-beta-1
    • Component/s: Compiler
    • Labels:
      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

              • Assignee:
                daniel_sun Daniel Sun
                Reporter:
                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